I'm still a beginner of php and I have come across a bit of a problem with the logical operator &&. I have a token and secret answer script which are both text boxes. When a user submits the token and there answer , the script goes into the database and if all checks clear (error messages etc), then goes through to the next step (Typing in there new password). The actual script works fine in my live site but for some reason its not working locally on my computer (which has got me a bit paranoid to be honest, just in case it's not 100% safe). With a lot of testing the script points to this bit of code :
if(isset($uid) && isset($uidTwo)) {
header('Location: reset.php');
exit();
}
The $uid stores the users_id from the users database and the $uidTwo stores the tables_id from the answer database (which also has user_id as one of its primary columns). When both are matched (True), the script goes on to the reset page.
I have done a lot of tests, changing the && to || seems to work and processes it through to the next page but that way only works for the token box and you can type in anything in the answer box like (ftgyhh) for example, so that's no good.
I have checked for headers already sent etc because I have error messages but nothing seems to work for the script locally.
So does anybody have any ideas that I could of missed?
EDIT: Did a var_dump on $uidTwo and found it was NULL, then i realised it could be the database side, so i imported an earlier version of the database and found it was that. The script now works locally, but reading both the database sql files before and after, i can't see what i did wrong. Oh well, these things are there to try us. Cheers guys for all your help