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
Post a Comment