I'm trying to compare two strings, one from a database and one from a POST request The POST one has been put through mysqli_real_escape_string The code is as follows
if (strcmp($a, $b)==0) {
echo "Match";
} else {
echo"from DB:";
var_dump($a);
echo"entered:";
var_dump($b);
}
The output is as follows
from DB:string(200) "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5eve1udb91QFEMuMVVMqLbq6uLSBdODMX/jnzZWqffnqFnlZHmGUOuyS2Dg4UbBeRSs8GkZxHexMc2w65KS58fpb6X2Buh7pPzPMqXK7jEyZp2p+VLffdZXiORGPwqOdvQOZgoO9eqDV/lb3IgzOHuz1R1To28H"entered:string(200) "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5eve1udb91QFEMuMVVMqLbq6uLSBdODMX/jnzZWqffnqFnlZHmGUOuyS2Dg4UbBeRSs8GkZxHexMc2w65KS58fpb6X2Buh7pPzPMqXK7jEyZp2p+VLffdZXiORGPwqOdvQOZgoO9eqDV/lb3IgzOHuz1R1To28HhX"
The two strings, if I put them in gedit and find and search for the first one, the second one is found So clearly they are equal What am I doing wrong?
Aucun commentaire:
Enregistrer un commentaire