28, May 2012

Redirect protected pages to login.php from neighboring folder subfolders - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Redirect protected pages to login.php from neighboring folder subfolders
« previous next »
Pages: [1] Print

Author 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: Male
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)

($page_protect->login_page = "../secure_login/login.php")

try pathes related to the root and it should work...

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3836
Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Redirect protected pages to login.php from neighboring folder subfolders
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 03:26:59 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.