php - textarea post gets diffrent result with or without "\"? -


textarea post gets diffrent result or without "\"?

the same code runs in different pc , diffrent result

my systerm xp , , post textarea , print , result has "\" befror ' , run in other guy's pc ,the result returns no "\".
defferent result cause when insert mysql , returns error when sql has no "\"
why happen ? how fix ?

<pre> <?php print_r($_post);  ?> </pre> <form method="post">     <textarea name="content" id="" cols="30" rows="10">this kate's book</textarea>     <input type="submit" /> </form> 

in pc ,get:

this kate\'s book 

in others, get:

this kate's book 

add in htaccess ok

php_flag magic_quotes_gpc 1 

the problem here comes magic_quotes_gpc setting in php.ini. have turn off: thing pure evil (and deprecated). "escapes" data automagically.

however, still want escaped. best way using pdo , prepared requests.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -