Can't compare a decrypted variable to a string ?

From: Date: Thu, 13 Oct 2005 15:49:26 +0000
Subject: Can't compare a decrypted variable to a string ?
Groups: php.general 
Request: Send a blank email to php-general+get-224056@lists.php.net to get a copy of this message
For some reason, I have to store a decrypted string as a variable before I can compare it to another string. The decrypt function is located in another php script //Get variable $cmd = $_REQUEST['cmd']; echo $cmd; // uJy4p09z6bSR80eLNFnBWBj/EsRCfIz2C/WrcFNcZE8=
echo decrypt($cmd);    // makesmil
$realcmd = decrypt($cmd); // 'makesmil'
    if(            decrypt($cmd)==    'makesmil')        makesmil();  // FAILS
    elseif(    decrypt($cmd)==    $realcmd)            makesmil(); //SUCCEEDS
I'm sure it is something stupid what am I doing wrong ? g

« previous php.general (#224056) next »