Forum Moderators: coopster
I've installed Apache and PHP on my pc and it's parsing the PHP however it's not reading the Query Strings in the URL. How do I go about getting it to recognise them?
EG: 127.0.0.6/index.php?dir=_incl&=page1
Should open the index and include a file in _incl called page1. However it's just defaulting to a default page if no Query String is called. Leading me to believe it's not parsing the Query String. This works online on my host.
Are Query Strings not enabled by default or is this because I'm using my PC as a Server & viewing files on it?
Win2k - Apache 1.3.? ( Most recent before Apache 2 ) - & most recent version of PHP.
With the register_globals ON you can directly refer to variables $_incl and $page_name from the URL [127.0.0.6...]
With the register_globals OFF you use the PHP Superglobal $_POST, $_GET, $_REQUEST, etc. Example, to get the variables from the URL [127.0.0.6...] you refer to them as ...
$dir = $_REQUEST['dir];
$page_name = $_REQUEST['page_name'];
I'm using is_file to do error checking on the query string varibles to check if those values/includes exist. However it's not working.
if (is_file("$incl")) {
include($incl);
}
else {
include('$error');
} I'm guessing something else isn't enabled by default that uses this. It's just going as far as this and including my default $incl which is $home and not using the $error when the called $incl isn't found. This script works on my hosts server just not mine on my PC.