MichaelMackey Posted May 28, 2008 Share Posted May 28, 2008 Hi, I'm fairly new to PHP, so far it's been fairly straight forward but I recently came across something that I wasn't sure how the best way to solve it would be. I am having an issue where if someone enters a '#' into a textbox, when javascript retrieves it it screws up and causes further issues (I assume # is a reserved character in JS). Anyway, I was wondering what the best way of dealing with this would be in PhP/JS? Is there an option with JS or PHP to prevent it from ever getting this far through validation checks? Or should I parse through the text before I submit and check for characters? Any info is appreciated, thanks. Link to comment https://forums.phpfreaks.com/topic/107633-php-js-and-special-characters/ Share on other sites More sharing options...
DarkWater Posted May 28, 2008 Share Posted May 28, 2008 How does it "screw it up"? Link to comment https://forums.phpfreaks.com/topic/107633-php-js-and-special-characters/#findComment-551737 Share on other sites More sharing options...
MichaelMackey Posted May 28, 2008 Author Share Posted May 28, 2008 Well I'm working with a previously set up system, there is currently a database street address with a "#" in it. When I tested the edit function for this person it would fail everytime, after looking into it I found the javascript would see the # and at that point it ignored everything else so the rest of the data never made it through. Link to comment https://forums.phpfreaks.com/topic/107633-php-js-and-special-characters/#findComment-551766 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.