Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Login Page</title>
- </head>
- <body>
- <form method="post" action="login.php">
- <table width="400" border="5" align="center">
- <tr>
- <td colspan="5" align="center"><h1>Login Form</h1></td>
- </tr>
- <tr>
- <td align="center">Email Address</td>
- <td><input type="email" name="email" placeholder="john.smith@email.com" /></td>
- </tr>
- <tr>
- <td align="center">Password</td>
- <td><input type="password" name="pass" placeholder="**********" /></td>
- </tr>
- <tr>
- <td colspan="5" align="center"><input type="submit" name="login" value="Login" /></td>
- </tr>
- </table>
- </form>
- <br>
- <center><strong>Not Registered Yet?</strong><br><a href="registration.php">Register Here<a></center>
- </body>
- </html>
- <?php
- ### CONNECT TO MYSQL DATABASE ###
- mysql_connect("localhost","root","") or die("Your Suck!");
- mysql_select_db("curispark");
- if(isset($_POST['login'])) {
- $password = $_POST['pass'];
- $email = $_POST['email'];
- $check_user = "select * users where user_pass='$password' AND user_email='$email'";
- $run = mysql_query($check_user);
- if(mysql_num_rows($run) > 0) {
- echo "<script>window.open('welcome.php','_self')</script>";
- }
- else {
- echo "<script>alert('Email or password is incorrect!')</script>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement