Re: Help with IF ELSE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> ----- Original Message ----- From: "David Stoltz" <Dstoltz@xxxxxxx>> To: <php-general@xxxxxxxxxxxxx>> Sent: Friday, December 05, 2008 1:19 PM> Subject: RE:  Help with IF ELSE>>>> The problem turned out to be, since I'm using the MCRYPT function to>> encrypt the password, once in a while the encrypted password will have a bad>> character:>>>> ßt¦?rDþž' Q…ß±–>>>> For example, the above has '>>>> This stops the PHP processing cold when executing the query to insert that>> string - no errors at all - just stops processing - and I do have>> display_errors turned on.>>>> So then, how does one store this type of string? I can't do a string>> replace....but there must be a way...>>>> If anyone has come across this, please let me know...>>>> Thanks!>>On Fri, Dec 5, 2008 at 7:25 AM, Sándor Tamás (HostWare Kft. )<sandortamas@xxxxxxxxxxx> wrote:> The solution is addslashes(). This function adds a backslash before special> characters in a string.>> http://php.net/manual/en/function.addslashes.php>> SanTa>
No, the solution would be mysql_real_escape_string(), or equivalent ifusing another database engine. However, in this case since you areencrypting the value (and since many encryptions return binary data)you could either hexdec() or base64encode() the value as well.
Andrew

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux