Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <h1><center>Please login </center></h1>
  2. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
  3.     Username: <input type="text" name="user_n">
  4.     Password: <input type="text" name="pass_w">
  5. <input type="submit" name="submit" value="Submit Form">
  6. </form>
  7. <?php
  8.     if(isset($_POST["submit"])){
  9.     $user_n = $_POST["user_n"];
  10.     $pass_w = $_POST["pass_w"];
  11.     $db_user = "mon_user";
  12.     $db_password = "mon_pass";
  13.     $db_database = "sqli";
  14.     $db_local = "localhost";
  15.     $dat = new mysqli($db_local, $db_user, $db_password, $db_database);
  16.     $query ="select secret_mess from users where Username=\"$user_n\" and Password=\"$pass_w\";";
  17.     echo $query;
  18.     $response = $dat->query($query);
  19.     $row = $response->fetch_assoc();
  20.     foreach($row as $item){
  21.         echo "This is your secret message: $item";
  22.     }
  23.     $dat->close();
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement