URL decode issue
uvaraj25 - July 1, 2009 - 05:35
Hi,
I have an issue with url when it is returning to the browser, actually after clicking submit button the url should return as "?q=myview/test&page=0" instead it is returning "?q=myview/test%26page%3D0". i have used urldecode function still no luck, can anybody help me in solving this issue.
Advance Thanks
Ram

URL decode issue
Hi
I was doing something similar and this is how I got around the issue using drupals url function.
Its api is at http://api.drupal.org/api/function/url/6
I wanted a basic query string sent in the url that looks like: http://localhost/drupal/user/reply?cid=8
but it was getting converted into :
http://localhost/drupal/user/reply/%253Fcid%253D8
which was causing problems on the target page for reading from the url.
So I just used the following code based on drupals url api to create the url with the query string attached:
$cid = // this value came from my database...
$options = array( 'query' => 'cid='.$cid ); // this $options array and its use is explained in the drupal url api above
$url_encoded = url( 'http://localhost/drupal/user/reply', $options );
and it worked fine on the other side when I went to retrieve the 'cid' value from the url with:
$cid = $_GET['cid'];
Hope that helps
Richard