Ajax PHP Login Page with Shake Animation Effect.

    Rating: ★★★★☆
    View: 185
    Download: 186
    Từ khóa:

    This will explain you creating user tables, posting form values and storing and destroying the session values. If you are a PHP beginner take a quick look at this live demo with Username: admin Password:123. This post has been updated with mysqli.

    Users Table
    User table contains all the users registration details. 

    CREATE TABLE `users` (
    `uid` INT(11) NOT NULL AUTO_INCREMENT ,
    `username` VARCHAR(45) ,
    `password` VARCHAR(100) ,
    `email` VARCHAR(45) ,
    `friend_count` INT(11) ,
    `profile_pic` VARCHAR(150),
    PRIMARY KEY (`uid`));

    Jquery Code

    Contains javascipt code, $("#login").click(function(){}- login is the ID name of the login button. Using element.val() calling username and password input values. If id value is even number if(id(even) % 2) = If(0) false
    
    
    

    index.php
    Contains PHP and HTML code, If session value exists this will  redirect to home page. 

    
    //HTML Code
    
    Username Password

    ajaxLogin.php
    Contains PHP code, this will verify username and password values in database.

    home.php
    If user session value is empty, this will redirect to login page.

    
    //HTML Code
    Welcome to Home Page
    Logout

    logout.php
    Cleaning the user session value.

    db.php
    Database configuration file, modify username, password and database values. 

     

    loading Đang tải...

    template được ưa chuộng