このコードを使用しているときは安全ではないことを知っているので、コードに追加できるものはありますか?
私は自己SQLインジェクションを試しましたが、どこかで機能していますが、SQLインジェクションについてあまり知識がないため、それほど多くはありません。しかし、ハッカーはより賢いので、私のウェブサイトを本当にハッキングできます.
URL は次のようになります。
http://example.com/profile.php?userID=1
php
$userID = $_GET['userID'];
$userID = mysql_real_escape_string($userID);
$CheckQuery = mysql_query("SELECT * FROM tbl_user WHERE id='$userID'");
$CheckNumber = mysql_num_rows($CheckQuery);
if ($CheckNumber !== 1)
{
header("Location: tos.php");
}
私は試した:
http://example.com/profile.php?userID=1'
現場で多くのものを隠します。
私が試したとき
http://example.com/profile.php?userID=1' UNION SELECT * FROM tbl_user; with havij it was hacked
ありがとう :|