Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1><center>Please login </center></h1>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- Username: <input type="text" name="user_n">
- Password: <input type="text" name="pass_w">
- <input type="submit" name="submit" value="Submit Form">
- </form>
- <?php
- if(isset($_POST["submit"])){
- $user_n = $_POST["user_n"];
- $pass_w = $_POST["pass_w"];
- $db_user = "mon_user";
- $db_password = "mon_pass";
- $db_database = "sqli";
- $db_local = "localhost";
- $dat = new mysqli($db_local, $db_user, $db_password, $db_database);
- $query ="select secret_mess from users where Username=\"$user_n\" and Password=\"$pass_w\";";
- echo $query;
- $response = $dat->query($query);
- $row = $response->fetch_assoc();
- foreach($row as $item){
- echo "This is your secret message: $item";
- }
- $dat->close();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement