Zubrag.com
September 21, 2018, 06:14:07 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: password protect and redirect problems  (Read 3292 times)
Ken62465
Newbie
*
Posts: 1


« on: February 03, 2012, 08:34:31 PM »

  I've been trying to solve a major problem with password protect and I can not seem to find the cause.  I have a few clients I want them to be able to log in and access only their projects so I'm using redictions.  After setting this up it works the first time but any subsequent visits and the homepage just flashes as if it's rediecting back home, which it is and I found out what's it's doing.  I have a LogIn link on my homepage that points to a dummy .php file in a "ClientOnly" folder.  In the dummy file I use the this as my first line.

<?php include("/home/atlanti1/public_html/ClientOnly/password_protect.php"); ?>

In the password protect file I've defined users and passwords as follows

$LOGIN_INFORMATION = array(
  'MetroWestSteel' => 'webviewer',
  'CaponeIron' => 'webviewer',
  'TimsFab' => 'webviewer',
  'AGIndustries' => 'webviewer'
);


Then I defined the redirects as follows

$REDIRECTS = array(
  'MetroWestSteel' => 'ClientOnly/MetroWestSteel/MetroWestSteel.php',
  'CaponeIron' => 'ClientOnly/CaponeIron/CaponeIron.php',
  'TimsFab' => 'ClientOnly/TimsFab/TimsFab.php',
  'AGIndustries' => 'ClientOnly/AGIndustries/AGIndustries.php'
);


At the very end of the password protect file I have this, which sits right in front of  ?>

header('Location: http://www.atlanticdetailservice.com/'.$REDIRECTS[$login]);


  As I said I can login and be redirected to the pages fine but not subsequent attempts and the login screen never appears again.  I suspected this to be a cookie issue so in Firefox I cleared cookies and it worked again for one login attempt then back to not working for sunsequent ones.  Trying to clear cookies in IE9 did no fix this like it did in Firefox and I even cleaned everything.  Now when you try a subsequent login my homepage just flashes so what it seems to me is happening is that the header line above is actually redirecting you but no variables after set the full string to desired so all you get is the http://www.atlanticdetailservice.com portion.  Any idea what the heck is happening?  Do we even need cookies set?  I'd prefer they'd always get the login screen and allow the saved password to fill the field in.

Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #1 on: February 06, 2012, 03:20:26 AM »

Sounds like everything is correctly implemented. Please send password_protect.php and your home page to   zu-bra-g@ gmail.com (remove spaces and dashes) and i'll have a look
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC