Re: Question on query string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 17 November 2004 00:28, Stuart Felenstein wrote:
> --- Richard Davey <rich@xxxxxxxxxxxxxxxx> 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?]
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux