Created
January 18, 2020 17:05
-
-
Save mamiwinsfall93/078274683240bf0bb406637a6f2a2de9 to your computer and use it in GitHub Desktop.
php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_POST['submit'])){ | |
$name_bad = $_POST['name']; | |
$name_bad = mysql_real_escape_string($name_bad); | |
$query_bad = "SELECT * FROM customers WHERE username = '$name_bad'"; | |
echo "<span style='color:green'>Escaped Bad Injection: <br />" . $query_bad . "<br />"; | |
echo "mysql_real_escape_string() function has helped escape mysql injections<br><br></span>"; | |
} | |
?> | |
<form method="post"> | |
<label>Please Insert 'OR 1' (with single quotes as it is i.e. 'OR 1') </label><br> | |
<input type="text" name="name"><br> | |
<input type="submit" name="submit" value="submit"> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment