Is this PHP code secure?
Posted
by Oliver Bayes-Shelton
on Stack Overflow
See other posts from Stack Overflow
or by Oliver Bayes-Shelton
Published on 2010-02-18T14:32:09Z
Indexed on
2010/04/03
12:53 UTC
Read the original article
Hit count: 419
php
Just a quick question: is the following PHP code secure? Also is there anything you think I could or should add?
$post = $_GET['post'];
if(is_numeric($post))
{
$post = mysql_real_escape_string($post);
}
else
{
die("NAUGHTY NAUGHTY");
}
mysql_select_db("****", $*****);
$content = mysql_query("SELECT * FROM tbl_***** WHERE Id='" . $post . "'");
© Stack Overflow or respective owner