Why $_REQUEST do the same thing as mysql_escape_string()

This is a discussion on Why $_REQUEST do the same thing as mysql_escape_string() within the PHP General forums, part of the PHP Programming Forums category; I put some thing in an form input filed like this: ' " \ then submit to a php script. When use $...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-17-2007
truncatei@gmail.com
 
Posts: n/a
Default Why $_REQUEST do the same thing as mysql_escape_string()

I put some thing in an form input filed like this:
' " \
then submit to a php script.
When use $_GET / $_POST / $_REQUEST to get the value,
I always get:
\' \" \\
In php expression it should be:
$_REQUEST['field'] = "\\' \\\" \\\\";

Any one who can tell me why?

Reply With Quote
  #2 (permalink)  
Old 10-17-2007
Eric Butera
 
Posts: n/a
Default Re: [PHP] Why $_REQUEST do the same thing as mysql_escape_string()

On 10/17/07, truncatei@gmail.com <truncatei@gmail.com> wrote:
> I put some thing in an form input filed like this:
> ' " \
> then submit to a php script.
> When use $_GET / $_POST / $_REQUEST to get the value,
> I always get:
> \' \" \\
> In php expression it should be:
> $_REQUEST['field'] = "\\' \\\" \\\\";
>
> Any one who can tell me why?
>


magic_quotes_gpc

Also it doesn't necessarily do the same thing.
mysql_real_escape_string() takes into consideration character sets.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:03 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0