php - Input crash on read slashes -


i'm getting problem saving input db.

i save string db as:

mysql_real_escape_string($my_string) 

then, read , place string input using this:

stripslashes($my_string) 

the point is, if set double slashes string, inputs crash this:

<input maxlength = "150" type="text" name = "my_string12" value = "hello "this is" test"  class="input-medium"/> 

thanks.

if value php variable have trim ..

use trim function:

$str = 'hello "this is" test'; echo trim($str, '"'); // hello test 

answered paul @ here


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -