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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -