PHP Select Statement and Special Signs
Moderator: General Moderators
-
Bogdan Zagan
- Forum Newbie
- Posts: 7
- Joined: Wed May 29, 2002 2:15 am
- Location: Romania
PHP Select Statement and Special Signs
How can I make a select if the database field is something like 'AAA\BBB.CCC'
-
Bogdan Zagan
- Forum Newbie
- Posts: 7
- Joined: Wed May 29, 2002 2:15 am
- Location: Romania
I used the to see what is actually passed into the SELECT statement.
When I enter in the text field the value
Code: Select all
<?php echo $HTTP_GET_VARSї"textfield"]; ?>When I enter in the text field the value
, the output isAAA\BBB.CCC
, so the PHP modifies my textfield entered value because of the containing \ sign.AAA\\BBB.CCC
Because in the database the field contains values like AAA\BBB.CCC, so I need to make a SELECT.Can I escape from this ?
-
Bogdan Zagan
- Forum Newbie
- Posts: 7
- Joined: Wed May 29, 2002 2:15 am
- Location: Romania
try using
Code: Select all
stripslashes($HTTP_GET_VARSї"textfield"]);- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
This is caused by having magic_quotes_gpc on in your php.ini file.so the PHP modifies my textfield entered value because of the containing \ sign
Macphp.net wrote:Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When magic_quotes are on, all ' (single-quote), " (double quote), \ (backslash) and NUL's are escaped with a backslash automatically.