Click to See Complete Forum and Search --> : Question about GET variables


Sore
12-16-2002, 07:37 AM
I have installed an apache/php at home on a linux machine.
I have now noticed that if i let php check for a GET variable with isset() and the URL:
www.site.com/page.php?variable
it doesnt react.
This works on my webhotel though. At home I have to give the variable a value also like:
www.site.com/page.php?variable=value
then it reacts.

Does someone know where this setting is?

trooper
12-16-2002, 08:25 AM
How are you checking your get vars ?

are you using $_GET ? or $HTTP_GET_VARS

$_GET only works after a certain version of PHP (4.0.1 i think - not sure).


I had a similar problem where my dev server and live server were running different versions of php

If $_GET / $_POST etc are not available simply try the following

if(!$_GET)
{
$_GET = array($HTTP_GET_VARS);
}


That'll work fine (also consider doing this for all the other super globals)

HTH

GM

Sore
12-16-2002, 01:35 PM
Im using $HTTP_GET_VARS. And to check it Im using isset();.
But why do I have to give the get variable a value on one of the servers and not the other?

jerdo
12-16-2002, 05:47 PM
Cause it's not a GET variable, if you use $_SERVER[QUERY_STRING] you'll get it.