Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <style>
- input[type=text] {
- border: 2px solid blue;
- border-radius: 4px;
- background-color: #3CBC8D;
- color: black;
- }
- input[type=email] {
- border: 2px solid blue;
- border-radius: 4px;
- }
- body{
- background-image:
- url("peni.jpg");
- background-size: 1800px 760px;
- }
- </style>
- </head>
- <body bgcolor=#00b3b3>
- <font>
- <center><h1>login</h1></center>
- </font>
- <center><br>
- <form action="login.php" method="POST">
- Username:<br><input type="text" name="uname"><br></br>
- Password:<br><input type="email" name="pass"><br>
- <br><input type="Submit" value="login"name="submit">
- </form>
- </center></br>
- </body>
- </head>
- </html>
- |
- |
- |
- |
- v
- <?php
- require('sql_connect.php');
- if(isset($_POST['submit']))
- {
- $username=mysql_escape_string($_POST['uname']);
- $password=mysql_escape_string($_POST['pass']);
- if(!$_POST['uname'] | !$_POST['pass'])
- {
- echo("<SCRIPT LANGUAGE='JavaScript'>
- window.alert('You did not complete all of the required fields')
- window.location.href='htmllogin.html'
- </SCRIPT>");
- exit();
- }
- $sql= mysql_query("SELECT * FROM `login_users` WHERE `username` = '$username' AND `password` ='$password'");
- if(mysql_num_rows($sql) > 0)
- {
- echo ("<SCRIPT LANGUAGE='JavaScript'>
- window.alert('Login Succesfully!.')
- window.location.href='htmllogin.html'
- </SCRIPT>");
- exit();
- }
- else{
- echo("<SCRIPT LANGUAGE='JavaScript'>
- window.alert('Wrong username password combination.Please re-enter')
- window.location.href='htmllogin.html'
- </SCRIPT>");
- exit();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement