Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <?php include('config.php'); ?>
  5. <title> This will get haxed </title>
  6.  
  7. <!-- <link rel="stylesheet" href="myCss.css" type="text/css" /> -->
  8.  
  9. <style>
  10. body
  11. {
  12.  
  13. background-color: black;
  14. color: red;
  15.  
  16. }
  17. </style>
  18.  
  19. </head>
  20. <body>
  21.  
  22. <?php
  23.     if(isset($_POST['submit']))
  24.     {
  25.         $name     =     mysql_real_escape_string($_POST['username']);
  26.         $password =     mysql_real_escape_string($_POST['password']);
  27.  
  28.        
  29.         $result = mysql_num_rows(mysql_query("
  30.                             SELECT * FROM users
  31.                             WHERE username = '$name'
  32.                             AND password   = '$password'
  33.                           "));
  34.         if($result==1)
  35.         {
  36.             $_SESSION['username'] = $name;
  37.             $_SESSION['password'] = $password;
  38.  
  39.             echo "You have logged in!\r\n!";
  40.             echo "Your username: " . $_SESSION['username'];
  41.         }
  42.     }
  43. ?>
  44.  
  45. <form  method="POST" action="<?php echo $_SERVER['PHP_SELF'] ;?>" >
  46.  
  47. <p>Username: </p>
  48. <input type="text"  name="username" />          <br />
  49.  
  50. <p> Password: </p>
  51. <input type="password"  name="password" />          <br />
  52. <input type="submit" name="submit"  value="send"    />  <br />
  53.  
  54. </form>
  55.  
  56.  
  57.  
  58.  
  59. <body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement