Click to See Complete Forum and Search --> : Getting values from the URL without variables


squishy
02-02-2007, 04:46 PM
How do I retrieve information sent in a URL in the form:
http://www.mysite.com/a_php_file.php?blahblahblah
Instead of what my PHP sources tell me to do, which is:
http://www.mysite.com/a_php_file.php?variable=blahblahblah
I have seen Perl scripts do this. I only assume PHP can as well... but I have yet to find sources telling me how.

If I dont include the variable, the PHP parser tells me there is an error...

NightShift58
02-02-2007, 05:04 PM
Not a good idea.

In this case, the "value" becomes the "variable". It may not work if the value thus passed doesn't conform to what PHP allows... but you could try this:<?php
$myGETS = array();
FOREACH ($_POST as $key => $value) :
$myGETS[] = $key;
ENDFOREACH;
?>

NogDog
02-02-2007, 05:26 PM
echo urldecode($_SERVER['QUERY_STRING']);

NightShift58
02-02-2007, 06:26 PM
Much better...