Results 1 to 4 of 4
Oct 13, 2011, 15:31 #1
Passing '&' in url via get method. stragne problem!
my html form 'company description' field sends "Computer Repair & Maintenance" value to php via ajax get method.
$description = $_POST["description"];
how to solve this issue?
i just tried puttingCode:
$description =urlencode( $_POST["description"]);
Oct 13, 2011, 15:47 #2
- Join Date
- Aug 2008
- The Netherlands
- 153 Post(s)
- 2 Thread(s)
you need to use encodeURIComponent in the AJAX script. When you're in the PHP you're too late, the damage is already done, because it will send your request like http://somedomain.com/?somekey=Computer Repair & Maintenance, so PHP will get array('somekey' => 'Computer Rapair ', ' Maintenance' => '');Rémon - Hosting Advisor
SitePoint forums will switch to Discourse soon! Make sure you're ready for it!
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy
Oct 13, 2011, 16:05 #3
Oct 14, 2011, 01:10 #4