note 33458 added to function.urldecode

From: Date: Thu, 26 Jun 2003 16:50:44 +0000
Subject: note 33458 added to function.urldecode
Groups: php.notes 
Request: Send a blank email to php-notes+get-51049@lists.php.net to get a copy of this message
Ok guyz I have good one for you! see if you can figure this one out I have a select box e.g. <form name='test' method=GET target='process.php'> ....// $varfromphpscript = '$id&name=$name&whatever=$what'; while loop begins { ?> <select name="select"> <option value='<?php echo $varfromphpscript; ?>'><?php echo $varnamefromphpscript ?></option> ..... </select> <?php } //while loop ends ?> </form> The while loop assigns values in select menu... Now I am using GET form method to post the form values to another page, the VALUE in select menu is URL strings, e.g. $id&name=$name constructs the URL to what I want i.e. http://www.whatever.com/process.php?select=23&name=ziggy&what=no which when posted gets encoded and changes to something like http://www.whatever.com/process.php?select=23%2name%3Dziggy%2what%3Dno NOW on process.php (the target page) i tried to be smart and used urldecode() to decoded the URL, back to the it should be! like this>> $url = $HTTP_SERVER_VARS["HTTP_HOST"] . $HTTP_SERVER_VARS["REQUEST_URI"]; $url = urldecode($url); Now the question is how do I extract the URL parameters which I use to get easily with $HTTP_GET_VARS[], but now I have the URL in $url, OR how to keep from URL getting encoded in first place? As for why do I have to post all these values via select menu! well all I can say is... I just have to! ---- Manual Page -- http://www.php.net/manual/en/function.urldecode.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33458 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33458&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33458&report=yes

« previous php.notes (#51049) next »