Page 1 of 1

how to prevent error of " ' " when input text?

Posted: Thu Apr 10, 2003 8:44 pm
by valen53
somethin like when we key in " didn't " in the textfield. how to prevent
" ' " occur error ? i just know add \ before ' . but when we insert data, how we know user will type ' ? any method can be prevent it ?

Posted: Thu Apr 10, 2003 11:06 pm
by bionicdonkey
string addslashes ( string str)


Returns a string with backslashes before characters that need to be quoted in database queries etc. These characters are single quote ('), double quote ("), backslash (\) and NUL (the NULL byte).

stripslashes

Posted: Sun Apr 13, 2003 4:10 pm
by phpScott
when using addslashes don't for to use the opposite command of stripslashes other wise you could end up in slash hell.

phpScott