Skip to content
pakainfo

Pakainfo

Web Development & Good Online education

  • Home
  • Blog
  • Categories
  • Tools
  • Full Form
  • Guest Post
    • Guest Posting Service
  • Advertise
  • About
  • Contact Us

jQuery Ajax Secure Login Registration System in PHP and MySQL

April 14, 2020 Pakainfo php, Ajax, JavaScript, jQuery, Mysql, Mysqli Leave a comment

Today, We want to share with you jQuery Ajax Secure Login Registration System in PHP and MySQL with validation code free download.In this post we will show you Create a Registration and Login System with PHP and MySQL, hear for Secure Login System with PHP and MySQL we will give you demo and example for implement.In this post, we will learn about student registration form in php code with validation with an example.

jQuery Ajax Secure Login Registration System in PHP and MySQL with validation code free download

Contents

  • jQuery Ajax Secure Login Registration System in PHP and MySQL with validation code free download
    • How to create a Registration and Login System with PHP and MySQL
    • Step 1Make a Database and Database Table
    • Step 2Connect to the Database
    • Step 3Session Make for Logged in User
    • Step 4Make a Registration and Login Form
    • Step 5Make a Dashboard Page
    • Step 6Make a Logout (Destroy session)
    • Step 7CSS File Make
    • Read
    • Summary
    • Related posts

There are the Following The simple About Full Information With Example and source code.

As I will cover this Post with live Working example to develop Creating a User Login System with PHP and MySQL, so the some major files and Directory structures for this example is following below.

How to create a Registration and Login System with PHP and MySQL

first of all Here are Main step to read and copy paste your file simple steps you have to follow to make a login system.

JQuery AJAX Login And Registration Form Using PHP MySQLi
  • Step: 1Make a Database and Database Table
  • Step: 2Connect to the Database
  • Step: 3Session Make for Logged in User
  • Step: 4Make a Registration and Login Form
  • Step: 5Make a Dashboard Page
  • Step: 6Make a Logout (Destroy session)
  • Step: 7CSS File Make

Step: 1Make a Database and Database Table

CREATE DATABASE memnerSignProject;

CREATE TABLE IF NOT EXISTS `users` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `authclient_name` varchar(50) NOT NULL,
 `email` varchar(50) NOT NULL,
 `authclient_password` varchar(50) NOT NULL,
 `member_created_at` datetime NOT NULL,
 PRIMARY KEY (`id`)
);

Step: 2Connect to the Database

databaseconfig.php

<?php
    $con = mysqli_connect("localhost","root","root","memnerSignProject");
    // Check connection
    if (mysqli_connect_errno()){
        echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
?>

Step: 3Session Make for Logged in User

auth_session.php

<?php
    session_start();
    if(!isset($_SESSION["authclient_name"])) {
        header("Location: signin.php");
        exit();
    }
?>

Step: 4Make a Registration and Login Form

registration.php

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Registration</title>
    <link rel="stylesheet" href="style.css"/>
</head>
<body>
<?php
    require('databaseconfig.php');
    if (isset($_REQUEST['authclient_name'])) {

        $authclient_name = stripslashes($_REQUEST['authclient_name']);

        $authclient_name = mysqli_real_escape_string($con, $authclient_name);
        $email    = stripslashes($_REQUEST['email']);
        $email    = mysqli_real_escape_string($con, $email);
        $authclient_password = stripslashes($_REQUEST['authclient_password']);
        $authclient_password = mysqli_real_escape_string($con, $authclient_password);
        $member_created_at = date("Y-m-d H:i:s");
        $query    = "INSERT into `users` (authclient_name, authclient_password, email, member_created_at)
                     VALUES ('$authclient_name', '" . md5($authclient_password) . "', '$email', '$member_created_at')";
        $result   = mysqli_query($con, $query);
        if ($result) {
            echo "<div class='form'>
                  <h3>You are registered successfully.</h3><br/>
                  <p class='link'>Click here to <a href='signin.php'>Login</a></p>
                  </div>";
        } else {
            echo "<div class='form'>
                  <h3>Required fields are missing.</h3><br/>
                  <p class='link'>Click here to <a href='registration.php'>registration</a> again.</p>
                  </div>";
        }
    } else {
?>
    <form class="form" action="" method="post">
        <h1 class="login-title">Registration</h1>
        <input type="text" class="login-input" name="authclient_name" placeholder="Username" required />
        <input type="text" class="login-input" name="email" placeholder="Email Adress">
        <input type="password" class="login-input" name="authclient_password" placeholder="Password">
        <input type="submit" name="submit" value="Register" class="login-button">
        <p class="link"><a href="signin.php">Click to Login</a></p>
    </form>
<?php
    }
?>
</body>
</html>

Step: 5Make a Dashboard Page

signin.php

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Login</title>
    <link rel="stylesheet" href="style.css"/>
</head>
<body>
<?php
    require('databaseconfig.php');
    session_start();
    // When form submitted, check and create client session.
    if (isset($_POST['authclient_name'])) {
        $authclient_name = stripslashes($_REQUEST['authclient_name']);    // removes backslashes
        $authclient_name = mysqli_real_escape_string($con, $authclient_name);
        $authclient_password = stripslashes($_REQUEST['authclient_password']);
        $authclient_password = mysqli_real_escape_string($con, $authclient_password);
        // Check client is exist in the database
        $query    = "SELECT * FROM `users` WHERE authclient_name='$authclient_name'
                     AND authclient_password='" . md5($authclient_password) . "'";
        $result = mysqli_query($con, $query) or die(mysql_error());
        $rows = mysqli_num_rows($result);
        if ($rows == 1) {
            $_SESSION['authclient_name'] = $authclient_name;
            // Redirect to client dashboard page
            header("Location: dashboard.php");
        } else {
            echo "<div class='form'>
                  <h3>Incorrect Username/authclient_password.</h3><br/>
                  <p class='link'>Click here to <a href='signin.php'>Login</a> again.</p>
                  </div>";
        }
    } else {
?>
    <form class="form" method="post" name="login">
        <h1 class="login-title">Login</h1>
        <input type="text" class="login-input" name="authclient_name" placeholder="Client Name" autofocus="true"/>
        <input type="password" class="login-input" name="authclient_password" placeholder="Enter your Secure Password"/>
        <input type="submit" value="Login" name="submit" class="login-button"/>
        <p class="link"><a href="registration.php">New Registration</a></p>
  </form>
<?php
    }
?>
</body>
</html>

dashboard.php

<?php
//include auth_session.php file on all user panel pages
include("auth_session.php");
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Dashboard - Client area</title>
    <link rel="stylesheet" href="style.css" />
</head>
<body>
    <div class="form">
        <p>Welcome To, <?php echo $_SESSION['authclient_name']; ?>!</p>
        <p>You are now user dashboard page.</p>
        <p><a href="logout.php">Logout</a></p>
    </div>
</body>
</html>

Step: 6Make a Logout (Destroy session)

logout.php

<?php
    session_start();
    // Destroy session
    if(session_destroy()) {
        // Redirecting To Home Page
        header("Location: signin.php");
    }
?>

Step: 7CSS File Make

style.php

body {
    background: #3e4144;
}
.form {
    margin: 50px auto;
    width: 300px;
    padding: 30px 25px;
    background: white;
}
h1.login-title {
    color: #666;
    margin: 0px auto 25px;
    font-size: 25px;
    font-weight: 300;
    text-align: center;
}
.login-input {
    font-size: 15px;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 25px;
    height: 25px;
    width: calc(100% - 23px);
}
.login-input:focus {
    border-color:#6e8095;
    outline: none;
}
.login-button {
    color: #fff;
    background: #55a1ff;
    border: 0;
    outline: 0;
    width: 100%;
    height: 50px;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
}
.link {
    color: #666;
    font-size: 15px;
    text-align: center;
    margin-bottom: 0px;
}
.link a {
    color: #666;
}
h3 {
    font-weight: normal;
    text-align: center;
}

Web Programming Tutorials Example with Demo

Read :

  • Jobs
  • Make Money
  • Programming
Also Read This 👉   Rregistration and login form in php and mysql with validation code free download

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about registration and login form in php and mysql with validation code free download.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Related posts:

  1. Create a Registration and Login System with PHP and MySQL
  2. registration and signin form in php and mysql with validation
  3. Nodejs Login and Registration with PHP MySQL and SQLite Example
  4. Laravel Custom Login Registration Example Tutorial
  5. Secure Login System with PHP and MySQLi – login page in php
  6. Rregistration and login form in php and mysql with validation code free download
complete login system php mysqlCreate a Registration and Login System with PHP and MySQLCreating a User Login System with PHP and MySQLlogin and registration form in php using sessionlogin system php source codephp: complete Login and registration system with php & mysql downloadregistration and login form in php and mysqlregistration and login form in php and mysql with validation code free downloadSecure Login System with PHP and MySQLSecure Registration System with PHP and MySQLsimple login form in phpstudent registration form in php code with validation

Post navigation

Previous Post:PHP Check If String Contains Substring
Next Post:Zip and Unzip Command using Linux(Ubuntu) Terminal

Advertise With Us

Increase visibility and sales with advertising. Let us promote you online.
Click Here

Write For Us

We’re accepting well-written informative guest posts and this is a great opportunity to collaborate.
Submit a guest post to [email protected]
Contact Us

Freelance web developer

Do you want to build a modern, lightweight, responsive website quickly?
Need a Website Or Web Application Contact : [email protected]
Note: Paid Service
Contact Me

Categories

3movierulz (64) Ajax (464) AngularJS (377) ASP.NET (61) Bio (109) Bollywood (108) Codeigniter (175) CSS (98) Earn Money (93) Education (63) Entertainment (130) fullform (87) Google Adsense (64) Highcharts (77) History (40) Hollywood (109) JavaScript (1359) Jobs (42) jQuery (1423) Laravel (1088) LifeStyle (53) movierulz4 (63) Mysql (1035) Mysqli (894) php (2133) Programming (2345) Python (99) Software (178) Software (90) Stories (98) tamilrockers (104) Tamilrockers kannada (64) Tamilrockers telugu (61) Tech (147) Technology (2416) Tips and Tricks (130) Tools (214) Top10 (506) Trading (95) Trending (76) VueJs (250) Web Technology (113) webtools (200) wordpress (166) World (343)

A To Z Full Forms

Access a complete full forms list with the meaning, definition, and example of the acronym or abbreviation.
Click Here
  • Home
  • About Us
  • Terms And Conditions
  • Write For Us
  • Advertise
  • Contact Us
  • Youtube Tag Extractor
  • Info Grepper
  • Guest Posting Sites
  • Increase Domain Authority
  • Social Media Marketing
  • Freelance web developer
  • Tools
Pakainfo 9-OLD, Ganesh Sco, Kothariya Ring Road, Chokadi, Rajkot - 360002 India
E-mail : [email protected]
Pakainfo

© 2023 Pakainfo. All rights reserved.

Top
Subscribe On YouTube : Download Source Code
We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype Guest Posting Sites