htmlspecialchars decode php mysql -


i posted inputs special characters. here input example i'm trying insert db:

<input type='text' name='address' value ='p. 34/1 ap. 4/4 rome, "xxx" street'> <input type='text' name='detail' value ='vat reg. no'> 

i inserted inputs in db these:

htmlspecialchars($_post['address']); htmlspecialchars($_post['detail']);  $db->sql_query(     "insert company set          option_type=1,          option_name='". htmlspecialchars($address)."',          option_value='". htmlspecialchars($detail)."'" );  

i retrieved records:

<input type="text" value="htmlspecialchars_decode($rows['address'])">  <input type="text" value="htmlspecialchars_decode($rows['detail'])"> 

this ok till now, values correctly inserted like:

adress: p. 34/1 ap. 4/4 rome, quot;xxxquot; street

detail: vat reg. no

but problem when read them db, displays nothing. tried use htmlspecialchars_decode , htmlentities() i'm not getting characters correctly displayed.

when used htmlspecialchars_decode() display values, detail value isn't displayed @ all, address ok.

please, can me?

you don't need convert special characters insert thos strings database. need escape using real_escape_string though.

you should use htmlspecialchars , such on output.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -