1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Coding a PHP Login System

Discussion in 'PHP & Perl' started by digitalpower, Jan 9, 2009.

  1. digitalpower

    digitalpower BANNED BANNED

    Joined:
    Dec 16, 2008
    Messages:
    303
    Likes Received:
    69
    I am working on a PHP login system but I am stumped. The system right now can do the following:

    1) User can create an account
    2) User can confirm their e-mail address
    3) User can login to the account and see member-only pages

    The problem is that once a user logs in and sees the web pages that only registered users can see, they can only see it once. Once they leave the page, they have to login again. I know you have to use $_SESSION and session_start() but I am confused. Can someone please assist? Also, if there is an already developed login system for PHP that is similar to the ASP.NET 2.0 Membership system, can you please let me know?
     
  2. Arthas

    Arthas BANNED BANNED

    Joined:
    Jan 5, 2009
    Messages:
    637
    Likes Received:
    322
    you mean if he leaves the members area? use a cookie
     
  3. HeXeR

    HeXeR Junior Member

    Joined:
    Dec 30, 2007
    Messages:
    121
    Likes Received:
    15
    Occupation:
    Self-employed
    Location:
    EU
    Home Page:
    Well php sessions use cookies to, but those cookies expire when you close you browse (unless you set ... session.cookie_lifetime)

    http://si2.php.net/manual/en/session.configuration.php

    But be careful, you can kill your server if you store to much sessions for long time, or even better, use sessions for login and stuff like that and only cookie for autologin.
     
  4. crashed

    crashed Jr. VIP Jr. VIP Premium Member

    Joined:
    Aug 13, 2008
    Messages:
    958
    Likes Received:
    1,198
    Occupation:
    Guru-slayer
    Location:
    Behind the VPN...
    Home Page:
    I have an old php login system that was plug and play, i did email it to someone but I cannot find it on any of my systems. I'll grab some of my backup discs out tommorow and look on them for ya.
     
  5. lokiceo

    lokiceo Registered Member

    Joined:
    Jul 26, 2008
    Messages:
    77
    Likes Received:
    30
    Location:
    WI
    Here is a pretty good tutorial on php/mysql user auth systems
    http://gigaspartan.com/?p=6
    I'm good with php, if you cant get this working, shoot me a pm.
     
  6. htmlgifted

    htmlgifted Newbie

    Joined:
    Dec 17, 2012
    Messages:
    3
    Likes Received:
    0
    Home Page:
    Hay lokiceo need some help with a php membership site manager script.. I posted a repled to this thread "
    [h=3]Ask me Any Questions about Membership Sites"[/h]I am using Membership site manager script for my members site and wanted to know if there is a special way to call the login and logout for teh site..... What i mean is my site has a login form on it and it is pointed to the members area but when you click login you get a small broswer window that asks for the same info then logs in. want to know how to find the file to call on login and out from inside the site plus show username of signed in user I am using the install file as a guide and used a shortcode they gave that works only in emails it seems.. Could use some help with this I have searched the net and have yet to find an answer.... that works.. for a login form, logout link and username dispaly.... thanks in advance..