Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors','0');
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Untitled Document</title>
- </head>
- <body>
- <div style="width:500px; height:300px; margin:auto">
- <div style="margin:auto">
- <?php
- session_start();
- include("includes/application.php");
- //echo $_SESSION['email'];
- ?>
- <form method="post">
- <h1>Login</h1>
- <table>
- <tr>
- <td>Email:</td>
- <td><input type="text" name="email"></td>
- </tr>
- <tr>
- <td>Password:</td>
- <td><input type="password" name="password"></td>
- </tr>
- <tr>
- <td></td>
- <td><input type="submit" name="submit" value="Submit"></td></tr>
- </table>
- </form>
- <?php
- if(isset($_POST['submit']))
- {
- $email=$_POST['email'];
- $password=$_POST['password'];
- $sql=mysql_query("select * from admin where email='$email' and password='$password' and status='1'");
- //echo "select * from admin where username='$username' and status='1'";
- $count=mysql_num_rows($sql);
- //echo $count;
- $row=mysql_fetch_array($sql);
- if($count==1)
- {
- $_SESSION['email']=$email;
- $_SESSION['auth']=$row;
- //header('location:home.php');
- ?>
- <script>
- location.href = 'home.php';
- </script>
- <?php
- }
- else
- {
- echo "invalid login credentials";
- }
- }
- ?>
- </div>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment