Re: Can't compare a decrypted variable to a string ?
| From: | Graham Anderson | Date: | Thu, 13 Oct 2005 18:13:57 +0000 |
| Subject: | Re: Can't compare a decrypted variable to a string ? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224078@lists.php.net to get a copy of this message | ||
many thanks :)
I'll try this
g
On Oct 13, 2005, at 10:27 AM, Jochem Maas wrote:
Graham Anderson wrote: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=try var_dump() or print_r() for more info on the var in question. ( like for instance that is actually 8 chars long as you expect.) as Robin Vickery pointed out you probably have blank space hanging around somewhere.echo decrypt($cmd); // makesmil$realcmd = decrypt($cmd); // 'makesmil'--PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpif( decrypt($cmd)== 'makesmil') makesmil (); // FAILS elseif( decrypt($cmd)== $realcmd) makesmil(); // SUCCEEDSI'm sure it is something stupid what am I doing wrong ? g