Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html><body>
- <h1>SQL Injection Test Site</h1>
- <h2>Login Form</h2>
- <form action="" method="post">
- Username: <input type="text" name="username">
- Password: <input type="text" name="password">
- <input type="submit"></form>
- <?php
- $db = mysql_connect($host, $user, $pass);
- if(!$db){
- die('Could not connect: ' . mysql_error());
- }else{
- mysql_select_db($database);
- }
- if(isset($_POST["username"]) && isset($_POST["password"])){
- $username = $_POST["username"];
- $password = $_POST["password"];
- $result = mysql_query("SELECT id FROM customer_data
- WHERE username = '$username'
- AND password = '$password'");
- $result = mysql_fetch_assoc($result);
- //we would now process the login if details matched
- echo "Logged in: " . $result['username'];
- }
- ?>
- </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement