Tags
PHP , HTML , XHTML
Asked 7 years ago
27 Nov 2016
Views 1290
jaman

jaman posted

escape string problem

Hi

i have problem with post method , every time when i post FORM and i get added / to single quote or double quote .
suppose
if input have value is "india" is 'good' than it goes into database /"india/" is /'good/'
and if input have value is /"india/" is /'good/' and it goes into database //"india//" is //'good//'

every time value get added / to single quote and double quote .
had you tried mysql_real_escape_string - Mitul Dabhi  
Nov 27 '16 02:52
yes i already did , but i get added / to single quote and double quote at $_POST value. - jaman  
Nov 27 '16 02:55
Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00

when you get / added to '(single quote) or "(double quote) at $_POST and $_REQUEST , $_GET . it means magic quote is on . so make it off all magic quote value .

how you can do it ?

go to php.ini and find the following varables and make it off
magic_quotes_gpc , magic_quotes_runtime , magic_quotes_sybase

like
magic_quotes_gpc = off
magic_quotes_runtime = off
magic_quotes_sybase = off

how to turn off magic quote directive at shared server , because i dont have acess of php.ini i raised question http://arrayoverflow.com/question/how-to-turn-off-magic-quote-in-shared-server/150 - jaman  
Nov 27 '16 03:29
ravi

ravi
answered Nov 30 '-1 00:00

its because of magic_quotes_gpc , when this directive on , ' ( single quote ) , " ( double quote ) , \ (backslash) and NUL's are escaped with a backslash automatically.so its happening with you .

so make it magic_quotes_gpc = off at php.ini

Post Answer