Click to See Complete Forum and Search --> : Another newbie question about .php?something=


michaeledooley
11-14-2003, 09:39 PM
Hi,

New to all this php stuff. I have seen at the end of links there is something along the lines of this:

www.somewhere.com/page.php?varible=value

Can anyone tell me or point me to where I can find out how the ?varible=value thing works?

Thanks,
Michael

pyro
11-14-2003, 10:30 PM
Basically, that uses the query string to pass a value to PHP. You can then use the superglobal $_GET (http://us4.php.net/manual/en/reserved.variables.php#reserved.variables.get) to extract the values. In your example it would look something like this:

<?PHP
$variable = $_GET['variable'];
echo $variable; # will print "value"
?>

michaeledooley
11-14-2003, 10:31 PM
Thank you!!!!

pyro
11-14-2003, 10:42 PM
You are very welcome. :)