How do I escape '+' in data I

h0nk

New Member
I was building a simple web based calculator which takes equations from a HTML form, evaluates it on the server using PHP and sends the result back.I am using Mootools to send the data via the \[code\]req.send\[/code\] AJAX operation.But, each time I have a '+' in an equation, it is not seen on the POST data the server gets.Any ideas why this is happening and how I can work around it?eg:\[code\]10 + 12\[/code\] in HTML form is seen as \[code\]10 12\[/code\] in the \[code\]$_POST\[/code\] data.The Mootools send command I am using is something like this with\[code\]<textarea name="equationTextArea">10+12</textarea>req.send("eqn="+$('equationTextArea').value);\[/code\]Upon submit, I see \[code\]$_REQUEST['eqn']\[/code\] as \[code\]10 12\[/code\].
 
Back
Top