I have been tasked with one insecure form, one secure form. For my insecure form, I have the PHP statement
$sql = "INSERT INTO Name(Name) VALUES ('$firstname')";
Here the user input is obviously taken directly from the from and saved as $firstname
. Now, I am having trouble actually injecting SQL into this form. Could someone point me in the right direction? I've tried dropping the table but I either get a SQL error or the injection actually is inserted.
EDIT: This is different from the question that is apparently a duplicate, as I know HOW to make it secure, what I'm trying to do is inject my already insecure code. The example in the duplicate question did not work for me and gave a syntax error.