Created
September 4, 2014 12:41
-
-
Save shohan4556/4c70af50ac81a09071b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include_once('db.php'); | |
// Using include_once(), we are including the file db.php By including this file, we automatically get connected to the database. | |
session_start(); //starting session | |
?> | |
<?php | |
// table name 'sign_up' | |
$email=$_POST['email']; | |
$pass=$_POST['pass']; | |
$sql="select count(*) from sign_up where (email='$email' and password='$pass');"; | |
// $sql = "SELECT count(*) FROM phplogin WHERE(username='".$uname."' and password='".$pass."')"; | |
// select count(*) from sign_up where (email='$email' and password='$pass'); | |
$qury=mysql_query($sql); | |
$result=mysql_fetch_array($qury); | |
if ($result[0]>0) { | |
# code... | |
echo "SUCCESSFULLY Login!!"; | |
$_SESSION['email']=$email; | |
echo "<br/> Welcome ". $_SESSION['email']. "!"; | |
echo "<br /><a href='logout.html'>Log Out</a>"; | |
} else { | |
echo " <br/> Login Failed"; | |
echo "<br /><a href='sign_in.html'>Sign Up</a>"; | |
echo "<br /><a href='sign_up.html'>Sign In</a>"; | |
# code... | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment