Re: using mysql_escape_string with implode() !!

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

 



On 5/30/07, Richard Lynch <ceo@xxxxxxxxx> wrote:
You want to use mysql_escape_string, and NOT addslashes and NOT Magic
Quotes.

function slashes( $var )
{
 if( is_array( $var ) )
 {
   return array_map( 'slashes', $var );
 }
 else
 {
   return mysql_real_escape_string( $var );
 }
}

set_magic_quotes_runtime( 0 );

if( get_magic_quotes_gpc() == 0 )
{
 $_GET = isset( $_GET )
   ? array_map( 'slashes', $_GET )
   : array();

 $_POST = isset( $_POST )
   ? array_map( 'slashes', $_POST )
   : array();

 $_COOKIE = isset( $_COOKIE )
   ? array_map( 'slashes', $_COOKIE )
   : array();
}


--
Greg Donald
http://destiney.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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