RE: Question on query string

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

 



To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm



On 16 November 2004 16: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[]"]:""))
> 
> 
> Still getting this:
> 
> ?Ind%5B%5D=1&Ind%5B%5D=2&Ind%5B%5D=3
> 
> I'm under the assumption the values get passed from
> search.php using urldecode() to searchresults.php.
> Maybe that is not the case.

URL encoding and decoding is done completely outwith PHP in this case -- the
encoding to %xx is done by the browser, and automatically decoded by the Web
server on the way through to PHP.  You should never see the %xx versions in
your script, and will have no need of urldecode().

The main problem with the above snippet that I can see is that there's very
unlikely to be such a thing as $_POST["Ind[]"] -- form fields with
name="Ind[]" will turn up as an array in $_POST["Ind"] ($_POST["Ind"][0],
$_POST["Ind"][1], etc.).  But the whole snippet looks very odd -- why are
you trying to pass POSTed values as GET variables on (I presume) a form
action??  Can you post a little context to the list to give us some idea
what you're really trying to do.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
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