Reply to Re: [PHP] Can't compare a decrypted variable to a string ?

Your name:

Reply:


Posted by Jochem Maas on 10/13/05 20:27

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=
> echo decrypt($cmd); // makesmil

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.

>
> $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
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация