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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -