im not very experienced in php. The problem i’m facing is:
print "post: {$_POST['var']} session: {$_SESSION['var']}\n";
let’s say this prints 2 equal outputs.
then
if($_POST['var'] == $_SESSION['var']){
...
}
never evaluates as true. What should I do to fix it?
Try the following:
You could also check the contents of the
$_SESSION['var']and$_POST['var']usingvar_dumpand see if they match: