This is really weird. I have a textbox inside a form. On clicking the submit button, the content of the textbox gets posted to page2.php
If the textbox contains a text like
This is a sample url
https://maps.google.com/maps?q=karnataka+badminton+association+bangalore&ie=UTF-8&ei=w4_lUNWmJozjrAfSkYGYBA&ved=0CAsQ_AUoAA
Now when i hit submit, i am echoing the content in page2.php and this is what i get:
//echo $_POST['message'];
This is a sample url
https://maps.google.com/maps?q=karnataka
I am getting the message but the URL gets cut after the first ‘+’. Any ideas how to get this work ?
I even checked with firebug the POST request and there it correctly displays the complete url.
NEW EDIT:
I am trying this with ajax now.
You should encode the url first. You can use encodeURIComponent(str) or encodeURI(str) embedded in javascript to do so. See: Encode URL in JavaScript?
You should then use urldecode/rawurldecode to decode the url into its native form. You can also store the decoded form and decode the url in php / javascript as needed. See:http://php.net/manual/en/function.rawurlencode.php