Simple Registration,login,logout in PHP

Register and Log In and Log Out Module

Sign Up -> Steps to follow:

1) Get User details from HTML form

2) Store User data in Data Base using PHP

Log In -> Steps to follow:

1) Get Login details from HTML form

2)   (i) Retrive User data from Data Base using PHP

(ii) Matching User Details

(iii) Match found then redirect to next page ( Also set some session variables )

(iv) Match not found show error message and redirect to login page

Check logged in or not -> Steps to follow:      ( it’s a PHP code)

1) Get session variables ( they created during login )

2) If session are empty show error and redirect to login page

Log Out -> Steps to follow:     ( it’s a PHP code)

1) Start session

2) Destroy session variables when logout clicked (this will prevent user enter after logout)



A) Simple Registration code:

1) HTML =>(filename -> form.html )




2) PHP =>( filename ->  register.php )



B) Simple login code:

1)HTML =>  ( filename -> login.html )

2)PHP => ( filename -> login.php )

C) PHP =>Simple login check code: ( Just Put below code as top of every page )

D) Simple log out code:

PHP =>  ( file name -> logout.php )











Leave a Reply

%d bloggers like this: