jquery - HTMLtags in input field -


I have a question about putting value in input field from my MYSQL db.

First I have a form of saving data from an input field to the database. An additional scripts filter direct Á => and Aacute; for HTML code. Then Állo to & amp; Aacute; Llo will be saved as

when I enter the data in 'div' from db, it will be allo . When I want to insert data into an input field, it will be & amp; Aacute; Llo

What am I doing

I use JQUERY to save data DB with $ .post method without pagerash. I get data from DB with the JQUERY $ .post method without PageRash.

Hope someone can help.

You really should not save the HTMLntities in your database. You should use Állo instead and use htmlspecialshars ($ my_value_from_db); If this is needed (this php does not know Running on your server, but there are similar functions for it, Pearl or other languages). If you can not change the savings process or correct the old entries, you can use the html_entity_decode ($ bla) for the values ​​shown in the input-field (this again php Is)


Comments