Advertisement
Guest User

Untitled

a guest
May 18th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2.  
  3. <html>
  4. <head>
  5. <TITLE>Welcome</TITLE>
  6. </head>
  7. <body>
  8. <form action="" method=POST>
  9. <div>
  10. <strong>Username:</strong><input type="text" name="username" value=""><br/>
  11. <strong>Password:</strong><input type="password" name="password" valuse=""><br/>
  12. <input type="submit" name="submit" value="Submit"><br/>
  13. </div>
  14. </forum>
  15. <?php
  16. session_start();
  17. echo "Hello world!";
  18. include('sql_connect.db.php');
  19. if(isset($_POST[submit])){
  20. $uname=$_POST['username']
  21. $pass=$_POST['password']
  22. }
  23. $result = mysql_query("SELECT * FROM users WHERE username=$uname")
  24. $row=mysql_fetch_array($result);
  25. $flag=0
  26. if($row)
  27. $usp=$row['password']
  28. if (pass==usp){
  29. $_SESSION['login_user'] = $uname;
  30. header("location: success.php");
  31. }else {
  32. $error = "Your Login Name or Password is invalid";
  33. }
  34. ?>
  35. </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement