Stupid question about $_GET and include()
Posted: Wed Mar 03, 2004 5:59 pm
I hope this all makes sense as I type this!
In my code, I'm using an index page that is holding all the locations of the links (i.e. index.php?loc=whateverpage)
This is the part of the code for it:
if(isset($_GET["loc"]))
{
$loc = $_GET["loc"];
if($loc=="mainmenujjtokoly")
{
include("client_homes/jjtokoly/mainmenu.html");
}
}
All of this is in a password protected website using sessions and a backend DB, but what's happening is when the application that I wrote tries to go to that link, the browser just returns a blank page, like the include file is not there or I have a path wrong (the file is there and the path is correct).
I know the user is getting logged in properly because in the mySQL DB, I write the time/date they logged in into a field.
The correct page based on the user that is logging in is getting called from the login page in this code snippet:
if ($_SESSION['user'] == "jjtokoly")
{
header('Location: index.php?loc=mainmenu'.$token);
}
$token is their username that I am adding to the end of the link. I know it's getting set because it shows up in the address bar in the browser properly.
But why won't the page display properly? Am I really missing something stupidly simple here? If you need more information, please let me know. Thanks!
-Joe
In my code, I'm using an index page that is holding all the locations of the links (i.e. index.php?loc=whateverpage)
This is the part of the code for it:
if(isset($_GET["loc"]))
{
$loc = $_GET["loc"];
if($loc=="mainmenujjtokoly")
{
include("client_homes/jjtokoly/mainmenu.html");
}
}
All of this is in a password protected website using sessions and a backend DB, but what's happening is when the application that I wrote tries to go to that link, the browser just returns a blank page, like the include file is not there or I have a path wrong (the file is there and the path is correct).
I know the user is getting logged in properly because in the mySQL DB, I write the time/date they logged in into a field.
The correct page based on the user that is logging in is getting called from the login page in this code snippet:
if ($_SESSION['user'] == "jjtokoly")
{
header('Location: index.php?loc=mainmenu'.$token);
}
$token is their username that I am adding to the end of the link. I know it's getting set because it shows up in the address bar in the browser properly.
But why won't the page display properly? Am I really missing something stupidly simple here? If you need more information, please let me know. Thanks!
-Joe