, ,
Asked 30+ days ago
27 Nov 2016
Views 241

jaman posted

escape string problem


i have problem with post method , every time when i post FORM and i get added / to single quote or double quote .
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 Jan 23 '18 20:16

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

magic_quotes_gpc = off
magic_quotes_runtime = off
magic_quotes_sybase = off

Edit Answer
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

answered Jan 23 '18 20:16

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

Edit Answer
Post Answer