Register Now


Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Cool Login Form With PHP (PHP: Hypertext Preprocessor), MySQL and jQuery

Login and user authentication is the most common feature in any dynamic website. We are going to create a simple login system using PHP (PHP: Hypertext Preprocessor) code on our pages, and a MySQL database to store our users information. The rar file contains the complete PHP (PHP: Hypertext Preprocessor) MySQL Login source code of our authentication script and a MySQL file to create and populate the required tables.

Cool Login Form With PHP (PHP: Hypertext Preprocessor), MySQL and jQuery


// connect to database
$con = mysql_connect(“localhost”,”root”,”technology”);
if (!$con)
die(‘Could not connect: ‘ . mysql_error());
//Select Database
mysql_select_db(“logindb”, $con);


// Database connection

// AJAX JQuery Validation

// Condition checks Submit button is set or not

// Select username and password from admin table
$result = mysql_query(“SELECT * FROM admin WHERE username=’$_POST[adminid]’ AND password=’$_POST[password]'”);

// Query checks Entered user id is valid or not…
if(mysql_num_rows($result) == 1)

//     redirects to admindashboard.php
header(“Location: admindashboard.php”);

// “Login Failed.. Please try again” message stores in variable $abc
$abc=”Login Failed.. Please try again”;

<form name=”formID” id=”formID” method=”post” action=””>
<p align=”center”><b> <u><h2>Login Page </h2></u><br>Enter User ID and Password to Login website <br>
<font color=”#FF0000″>
// prints if its invalid password
echo $abc;
<p> <strong>User Name :
<input type=”text” name=”adminid” id=”adminid” />
<p><strong>Password :
<input type=”password” name=”password” id=”password” />
<input  type=”submit” name=”btnlogin” id=”btnlogin” value=”Login” />
<input  type=”reset” name=”button2″ id=”button2″ value=”Reset” />
<br />

Table Design :

Download Source Code :


Comments ( 6 )

  1. Very very thanks…

  2. // prints if its invalid password
    // echo $abc
    function failed() {
    global $abc;
    echo $abc;}

  3. amazing …..thanks.

  4. can i get the complete synopsis for this project?send it to [email protected]

  5. can i get the complete synopsis for this project?send it to [email protected]

Leave a reply

About StudentProjects.Live

A collection of source codes that I wrote in Android, ASP.NET, PHP, C#.NET, VB.NET and JAVA in a course of my career as web developer and software engineer that I would like to share to my fellow programmers. Some of the codes here is not my original work that I found over the Internet and Books while I'm learning how to program. I hope you find my work useful in your learning in programming. Please share my work to other people also who interested to learn the basics of web development and programming. Thank you very much and Happy Productive Programming Everyone.

Follow Me