Signup : Login , verification & Logout

Verification of user Email
Login verfication and Session After verification of email address, user can login by using their userid and password. System will check userid , password and status of the member by comparing the user input data with mysql table.

Login form

We will ask the user to enter userid and password in the textbox provided. In this page we will proved two more links saying Forgot password and Signup. The submit button in the form will send the userid , password to backend script for verification.


Posting of data to backend script is done using JQuery Post method. After verification at backend script we get the message saying about success or failure of validation.

Backend Script for authentication

We receive the userid and password at backend script by using POST method.
We collect the matching records from database by using the userid and then check the password is matching with user entered password or not. We will also check status of the user as it must be equal to C to ensure only email verified users are allowed to login.
The query matching to all these conditions is here.
SELECT userid, password,mem_id FROM mem_signup  WHERE userid=? and status = 'C'
By using SELECT query we get the matching data for the user entered userid.

Matching password.

We used password_verify() to match the stored passwod against user entered password.
if(password_verify($password,$row->password)){
 // create the session and welcome message 
}else { 
// Failure of login 
}

Creating Session

We create Session Variables once the user is successfully logged in
$_SESSION['id']=session_id();
$_SESSION['userid']=$row->userid;
$_SESSION['mem_id']=$row->mem_id;

Sending back the message to login page.

Based on the outcome of checking the userid and password , we will send message to main login.php page after creating session ( if successfully logged in ). Based on this outcome we will redirect the member to home page (index.php).

Additional features

Number of failed attempts
Storing IP details
Expire of Page
Redirect to referrer page.


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here .







    Most Popular JQuery Scripts

    1

    Two dependant list boxes

    2

    Calendar with Date Selection

    3

    Data change by Slider

    4

    Show & Hide element


    JQuery Video Tutorials




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer