Forum Moderators: coopster

Message Too Old, No Replies

globals on but $ GET does not work

         

torresl

2:14 am on Feb 6, 2010 (gmt 0)

10+ Year Member



I'm trying this simple code:
I have one file with:
form name="xform" action="output_form.php" method="get">
<input name="gobutton" type="submit" value="Go" />
<input name="client" type="text"/>
</form>

and another...
<?php
echo $_SERVER['QUERY_STRING'];
echo $_GET['client'];
?>

I get output from "$_SERVER['QUERY_STRING'];" but not from "$_GET['client'];"

the url is "output_form.php?gobutton=Go&client=test"

IanKelley

1:03 am on Feb 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Odd... some kind of PHP config problem maybe.

What is the value of $_REQUEST['client'] ?

jkovar

4:05 am on Feb 7, 2010 (gmt 0)

10+ Year Member



The manual seems to indicate that you can't turn track_vars, the directive that is responsible for whether the $_GET, $_POST, etc arrays are populated, off past PHP 4.0.3

IanKelley

6:26 am on Feb 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes that's true but possibly the data is ending up somewhere else, maybe $_POST, that's why I was curious if $_REQUEST was being populated.

PHP could be getting confused by the data passed by the OS, although I've never heard of that happening before.