houssam_ballout Posted July 4, 2011 Share Posted July 4, 2011 Hello,I had a drop-down box that list the items, well one of the items had the & in its name , when I click submit it won't work, its problem with the &, how can I fix it?Thanks Link to comment Share on other sites More sharing options...
birbal Posted July 4, 2011 Share Posted July 4, 2011 what problems actualy you are having now when you submit? Link to comment Share on other sites More sharing options...
Ingolme Posted July 4, 2011 Share Posted July 4, 2011 Is Javascript involved in the form submission? Link to comment Share on other sites More sharing options...
houssam_ballout Posted July 4, 2011 Author Share Posted July 4, 2011 Is Javascript involved in the form submission?Take a look here:http://www.metropolitansecurity.com.lb/vendorusername: test password: testchose Faceproducts , then chose H&H you can't select it Link to comment Share on other sites More sharing options...
Ingolme Posted July 4, 2011 Share Posted July 4, 2011 The login isn't working for me so I can't see the problem.There shouldn't be any problems with the & character unless Javascript is sending it unencoded. Link to comment Share on other sites More sharing options...
houssam_ballout Posted July 5, 2011 Author Share Posted July 5, 2011 The login isn't working for me so I can't see the problem.There shouldn't be any problems with the & character unless Javascript is sending it unencoded.trytest5 with password 123Thanks Link to comment Share on other sites More sharing options...
Ingolme Posted July 5, 2011 Share Posted July 5, 2011 Just as I suspected. You're making Javascript send values. Encode the values before using them. This should be in your reload2() function:var val = encodeURIComponent( form.tag.options[form.tag.options.selectedIndex].value );var val2 = encodeURIComponent( form.product.options[form.product.options.selectedIndex].value );Your login system has an error. A warning appears in the source code right after logging in: <b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/home/metrolb/public_html/vendor/order.php</b> on line <b>417</b><br /> Link to comment Share on other sites More sharing options...
houssam_ballout Posted July 5, 2011 Author Share Posted July 5, 2011 Just as I suspected. You're making Javascript send values. Encode the values before using them. This should be in your reload2() function:var val = encodeURIComponent( form.tag.options[form.tag.options.selectedIndex].value );var val2 = encodeURIComponent( form.product.options[form.product.options.selectedIndex].value );Your login system has an error. A warning appears in the source code right after logging in:<b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/home/metrolb/public_html/vendor/order.php</b> on line <b>417</b><br /> Thanks it worked Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.