I have a form which sends form data for processing and accordingly receive the response. my forms have fields such as name, email, phone etc. the problem is while sending the data across if the name have spaces inbetween then it will send the data along with that spaces for example, the Ajax sends the following data as request for processing.
option=saveuser&gender=1&roleId=5&name=Mohmmed Noufil Damudi&email=i@i.com&password=mypassword&pPhone=8888888888&sPhone=8888888888
Is it ok to have spaces in between while sending request via Ajax? or am i doing the wrong way to send data? should i be converting the string to an array or jSON before sending? or does the above string look okay for sending the form data across the server for processing?
thank you.
Have a look at http://api.jquery.com/serialize/
Sending it this way, you can grab the data on your processing page from the $_POST-array.