How can you make it so when a user posts some text with ' in them, not screw it up?
A Adam01 New Member Messages 114 Reaction score 0 Points 0 Jan 6, 2008 #1 How can you make it so when a user posts some text with ' in them, not screw it up?
Penguin129 New Member Messages 68 Reaction score 0 Points 0 Jan 6, 2008 #2 Could you please elaborate on "screw it up"? Your question is quite vague.
Xemnas New Member Messages 812 Reaction score 0 Points 0 Jan 6, 2008 #3 I think what he meant is, when you post the quotation mark, it doesn't terminate the string or the SQL query.
I think what he meant is, when you post the quotation mark, it doesn't terminate the string or the SQL query.
kajasweb New Member Messages 1,723 Reaction score 0 Points 0 Jan 6, 2008 #4 If you get the strings from user and want to use it, escape the quotation marks. $input = str_replace("'","\'",$input); Last edited: Jan 6, 2008
If you get the strings from user and want to use it, escape the quotation marks. $input = str_replace("'","\'",$input);
Synkc Active Member Messages 1,765 Reaction score 0 Points 36 Jan 6, 2008 #5 You could also convert the quotation characters to their html entities: $string = str_replace( '"','"', $string ); $string = str_replace( "'",''', $string );
You could also convert the quotation characters to their html entities: $string = str_replace( '"','"', $string ); $string = str_replace( "'",''', $string );