Hello, this may seem like a stupid question, but it is stumping me nontheless. I'm sure that the answer is something small. I think it's just one of those situations where I have been looking at the code for too long.
I am trying to compare two PHP variables to see if they are the same. As you can see below, I am comparing $verification_answer
with strrev(date("Ymd"))
which is today's date, reversed. So today, $verification_answer
would be 31700102. Every time I try to do the comparison, however, the if statement executes (as a non-match).
$verification_answer = strrev(date("Ymd"));
if($verification != $verification_answer){
$failed .= "<h2>Attention:</h2><p>The verification code is incorrect. Please try again.</p>";
}
Can anyone see the issue? Thanks!
UPDATE: $verification
is from HTML user input:
$verification = mysql_escape_string($_POST['verification']);