Skip to content

Instantly share code, notes, and snippets.

@iAklis
Last active August 29, 2015 14:24
Show Gist options
  • Save iAklis/1c423d55eb360137a94a to your computer and use it in GitHub Desktop.
Save iAklis/1c423d55eb360137a94a to your computer and use it in GitHub Desktop.
强网杯-最好的语言100分
<?php
//TODO: connect to DB
$id = $_GET['id'];
//TODO: sqli filter
$secretId = 1024;
if($id == $secretId){
echo 'Invalid id ('.$id.').';
}
else{
$query = 'SELECT * FROM notes WHERE id = \''.$id.'\';';
$result = mysql_query($query,$conn);
$row = mysql_fetch_assoc($result);
echo "notes: ".$row['notes']."</br>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment