PDA

View Full Version : Solution needed for : Database error due to bad parsing of variables


cinq
06-17-2004, 01:18 PM
Some sites that have linked to certain pages I have on my site are wrongly parsing the & symbol in the url , instead giving such a link like :


http://www.mydomain.com/forum/articles.php?action=viewarticle&artid=1


Instead of this :


http://www.mydomain.com/forum/articles.php?action=viewarticle&artid=1


and as a result I am getting many database errors and well as visitors getting the error page.

Is there anything , on my end , that I can do to rectify this problem ?

Help most appreciated :)

Velocd
06-17-2004, 05:40 PM
Look for the function htmlspecialchars() (http://www.php.net/htmlspecialchars) in the code. This translates symbols like & into their special char equivalent.

To revert, use html_entity_decode() (http://www.php.net/manual/en/function.html-entity-decode.php)

NTLDR
06-17-2004, 08:28 PM
vBulletin also has its own function to revert: unhtmlspecialchars() (see includes/functions.php) and also a unicode safe version of htmlspecialchars: htmlspecialchars_uni()

cinq
06-18-2004, 03:27 AM
Thanks guys, but what puzzles me is that those links are placed in the templates.

ie.


http://www.mydomain.com/forum/articles.php?action=viewarticle&artid=$artid