User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 397,598 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,822 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 901 | Replies: 3 | Solved
Join Date: Mar 2008
Posts: 2
Reputation: rajivloharuka is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rajivloharuka rajivloharuka is offline Offline
Newbie Poster

How to send & as data using _POST method using Ajax

  #1  
Mar 24th, 2008
Hi All,
I am trying to send some data using Ajax and recieve that data in php code using _POST method.

But my data contains "&" and _POST method takes it as a seperating token and data after tht does not get passed. Does anyone has a solution to this.

Code snippet:

params = "q="+str+"&p="+str1;  //here str1 contains data which has &


  xmlHttp.open("POST",url,false);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.send(params); 

And on server side when I use
$posted = &$_POST ;

it takes & as a seperator which is present as data.

Please someone let me know the workaround or approach to this.
Last edited by peter_budo : Mar 24th, 2008 at 6:20 am. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 6:36 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC