Re: Question on query string

From: Date: Tue, 16 Nov 2004 17:58:32 +0000
Subject: Re: Question on query string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-202188@lists.php.net to get a copy of this message
On Wednesday 17 November 2004 00:28, Stuart Felenstein wrote: > --- Richard Davey <rich@launchcode.co.uk> wrote: > > Use urldecode() to get them back to "normal" again. > > Changed the form action line to this: > > action="searchresults.php?Ind=<?php echo > urldecode(((isset($_POST["Ind[]"]))?$_POST["Ind[]"]:"")) When you're building a query string then (in general) there is no need for urldecode(). On the contrary you want to use urlencode(), this is done on the *value* of the individual parameters. And about this: $_POST["Ind[]"], it's obvious you haven't absorbed what I said about this particular construct. Please re-read my previous post regarding this and try to understand it. > Or should I do a $_GET['Ind'] = urlencode('Ind') on > searchresults.php ? If the URL on the searchpage was constructed properly then on searchresults.php the values passed can be read from $_GET directly with no further processing (ie no need for urldecode() and other such nonsese) on your part. But remember, you still need to validate the data you get from $_GET (and in general from $_POST etc) before you use them. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Unix soit qui mal y pense [Unix to him who evil thinks?] */

« previous php.general (#202188) next »