Jump to content

POST Variables contains "+"


leon_nerd

Recommended Posts

Hi Guys,

 

I am making some AJAX calls and passing some POST variables. The POST parameters happen to contain "+" character. It is something like prod1=A4+&prod2=fullsize. When I try to read the $_POST[prod1] it returns "A4 ". There is no + sign and it replaced by a white space. Am I doing something wrong? How can I read POST variables that contains "+" character.

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/185394-post-variables-contains/
Share on other sites

I am making an AJAX call. So, I am building up the string using the javascript "+" to concatenate various variables for POST. Then I am using

http_request.open('POST', url, true);
. So, how can I use the urlencode() here since I am creating the parameter string in javascript?

Thanks a lot salathe :D. That worked. It was kind of silly of me to forget this simple function. :shy:

 

Thanks everyone for putting in your views. I was not expecting this kind of turnaround time for my problem. Just amazing to see this kind of response. Will be around. Thanks :)

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.