Jump to content

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 :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.