Guest User

Untitled

a guest
Apr 25th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <?php
  2. include("head.php");
  3. $username = mysql_real_escape_string($_POST['username']);
  4. $password = mysql_real_escape_string($_POST['password']);
  5. if($_POST['sent'] == "1")
  6. {
  7. if (!$username && !$password)
  8. {
  9. $error = "No Username Or Password";
  10. }else{
  11. $query = "SELECT * FROM users WHERE username='$username' AND password='".md5($password)."'";
  12. $string = mysql_query($query);
  13.  
  14. $select = mysql_num_rows($string);
  15. if ($select == 1)
  16. {
  17. setcookie("USER", $username, time()+3600);
  18.  
  19. header("location: /members/myaccount.php");
  20.  
  21.  
  22. }else{
  23. $error = "User Not Found";
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30. }
  31. }
  32. if (!$error)
  33. {
  34.  
  35. }else{
  36. echo "<div align='center'>";
  37. echo "<table class='Error'>";
  38. echo "<tr></tr>";
  39. echo "<td align='left'>$error</td>";
  40. echo "<tr></tr>";
  41. echo "</table>";
  42. echo "</div>";
  43. }
  44.  
  45. ?>
  46. <div align="center" id="login">
  47. <table>
  48. <form action=" " method="POST">
  49. <input type="hidden" name="sent" id="sent" value="1">
  50. <tr></tr>
  51. <th align="right">Login To Go To Members Area</th>
  52. <tr></tr>
  53. <td align="right"><label>Username: </label><input type="text" name="username" id="username"></td>
  54. <tr></tr>
  55. <td align="right"><label>Password: </label><input type="password" name="password" id="password"></td>
  56. <tr></tr>
  57. <td align="center"><input type="submit" value="Login"></td>
  58. <tr></tr>
  59. </table>
  60. </form>
  61. </div>
Add Comment
Please, Sign In to add comment