User Login/Logout System

Discussion in 'PHP' started by Vizuke, May 30, 2006.

  1. #1
    Is anyone experience slow refreshing rate on login? I think the current why I have it logged in is inefficient but I don't know how to do a better one. Currently, I have it off $_POST[] to be saved under $_SESSION[] and meta refresh the page to log the user in but it is way to slow. Is there a better way?
     
    Vizuke, May 30, 2006 IP
  2. pwaring

    pwaring Well-Known Member

    Messages:
    846
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Why don't you just redirect the page in PHP, using something like:

    header('Location: http://www.example.com/loggedin.php');
    PHP:
    That will redirect automatically, rather than waiting for a new page to load and then however long you have set the meta refresh value to be.
     
    pwaring, May 31, 2006 IP
  3. sketch

    sketch Well-Known Member

    Messages:
    898
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    148
    #3
    Just make sure to add exit(); after the header command so that the browser shows the correct URL :)
     
    sketch, May 31, 2006 IP
  4. pwaring

    pwaring Well-Known Member

    Messages:
    846
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    135
    #4
    Aye, I forgot to include that, never worked out why it doesn't change the browser URL.
     
    pwaring, May 31, 2006 IP
  5. itrana123

    itrana123 Peon

    Messages:
    177
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i never have experienced of slow Refereshing rate at login page. please make your code clean and and use header functiont to redirect when the user successfully logged in to a page where you want to redirect...

    header('location: http://www.domainname.com/welcome.php');
     
    itrana123, May 23, 2007 IP