Login/ Register With Email- Login Form

social media

Create Your Login Form :

<form method="POST" name="login" id="login" action="?login=true">
<label>Email</label> <input type="text" name="email" size="20">
<label>Password</label> <input type="password" name="password" size="20">
<input type="submit" value="Submit" name="submit">
</form>

You can either use HTML 5 form field validation or jQuery form field validation to validate your login form.

Validate user authentication through PHP:

<?php
include("connection.php");

if($_GET['login']=='true'){
	$email = mysql_real_escape_string($_POST['email']);
	$password = mysql_real_escape_string(md5($_POST['password']));
	$sql = mysql_query("select * from register where email='".$email."' 
	and password ='".$password."' and status='active'");
	$numrow = mysql_num_rows($sql);

	if($numrow == 1){
		$str="Welcome to A2Z webhelp";
		header("Location:welcome.php?msg=$str");
	}else{
		$str="Sorry, Invalid login details.";
		header("Location:login.php?msg=$str"); 
	}
}
?>

Other Login/ Registration Systems

Login/ Register With Facebook
Login/ Register With Twitter
Login/ Register With Linked In
Login/ Register With Yahoo!
Login/ Register With Gmail
Login/ Register With Hotmail

Comments
14 February
2014
ctel
nice
13 February
2014
Mukesh Kumar
How do i connect the mysql data base connectivity to any php form.
Please i should be code, please urgent sir....
06 February
2014
annie
I was seriously searching in the net on how to create a simple registration form eventhough it seems to be very simple it is definitely a tedious task and you have made me an expert in this filed.Well donehttp://www.powered.com/
23 January
2014
sundari
how do i compare the values in registration table likely username password, to check the login table both of them match and then print the message. please give a coding in php.
05 January
2014
Satyam upadhyay
nice
05 November
2013
James Dean
Where does the code for saving the data into mysql table go. Is it in the registration form?
22 January
2014
Ali
I would like the answer to that question as well--.
comments powered by Disqus