Jump to content

pass an ampersand to a database through AJAX......


scarhand

Recommended Posts

I didnt know exactly where to put this so I posted it in PHP and AJAX forums

 

I'm having problems passing an ampersand through AJAX to a database.

 

htmlspecialchars will convert and send all other chars to the database, except ampersand

 

heres my message variable before its inserted into the database:

 

$message = mysql_real_escape_string(htmlspecialchars($_POST['message'], ENT_QUOTES));

 

is there any other php procedures that I could use so that my AJAX script will pass ampersands into the database?

  • 3 weeks later...

I've never run into this problem, but it occurs to me that you could use the ascii code to make the transit and then back to the character to make the comparison.

Just a thought, seems simple enough.

2 PHP functions of interest:

ord()

chr()

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.