Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

htmlspecialchars display problem

Status
Not open for further replies.

NigeW

Programmer
Jun 10, 2002
134
NZ
Hi there

I have a form which has dynamically built select lists.

The select lists are created via 'AJAX', i.e. an http post/response call using JavaScript and PHP.

The data in the database table has been added using htmlspecialcahrs function and as an example the entry is Bee's Knee"s.

However the options are still being displayed as shown above - it is not converting to html.

I have done some testing and output the same data directly to a select list - this displays prefectly.

So I am assuming there is something in the 'AJAX' process causing the problem.

Anyone got any ideas ?

Thanks

Nigel Wilson
Christchurch Web Design
 
not really the ajax process. it's more that you will be replacing innerHTML (i guess) with the special chars and so they will show on the screen as their literal equivalents. whereas you will actually want them being part of the source code.

in your exported function you either need to convert the field data back into pure html or change your db writes to use the more traditional form of escaping characters (i know that vragabond recommended htmlspecialchars in an earlier post - i have yet to get my head around this).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top