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
Stupid question about $_GET and include()
Moderator: General Moderators
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
PHP Warning: main(client_homes/jjtokoly/mainmenu.html) [function.main]: failed to create stream: Permission denied in C:\Program Files\Ensim\Sitedata\my_markovich\Inetpub\wwwroot\index.php on line 129 PHP Fatal error: main() [function.main]: Failed opening required 'client_homes/jjtokoly/mainmenu.html' (include_path='.;c:\php4\pear') in C:\Program Files\Ensim\Sitedata\my_markovich\Inetpub\wwwroot\index.php on line 129
This is the error that gets returned. What I don't understand is that it works for one login, but not any of the rest!
Could this be stemming from the folder permissions. Should I do a chmod on them?
-J
This is the error that gets returned. What I don't understand is that it works for one login, but not any of the rest!
Could this be stemming from the folder permissions. Should I do a chmod on them?
-J