Topic: Redirect protected pages to login.php from neighboring folder subfolders (Read 938 times)
Just another rainy day
Posts: 1
10 credits Members referred : 0
« on: Aug 26, 2006, 04:53:52 pm »
Olaf, First- thanks for a very comprehensive login class.
I am setting up a large site with several main level folders to organize the pages. I have set the login script in one of these folders labeled "secure_login". The "classes" folder is set at the web document root. The protected pages in the "secure_login" folder will return to the login page as default (using the "header("Location: ".$this->login_page);" call) when a user is not logged in.
For the pages that are located in an adjoining folder such as "main" the protect page call "$page_protect->access_page($_SERVER['PHP_SELF'], "", 1) is looking for the login.php inside the "main" folder because of the "$_SERVER['PHP_SELF']" call.
I have tried without success setting the login_in page path as a property before the protect page call is made ($page_protect->login_page = "../secure_login/login.php")
What would be the best way to set the path to an adjacent folder "secure_login" for the redirect to "login.php"? Can it be done without using an absolute link? I am trying to keep from setting a path inside these folders based off the document root if I can.
Thanks for your good work.
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Aug 26, 2006, 05:04:12 pm »
this kind of pathes doesn't work very well in PHP: (because of all the include files)