hi guys
I run a website that has been a target for hackers 🙁 now ive placed some extra security into the pages that they were using to get in i,ve made a standard 403 page but i would like to log the IP address that get to this page i have done this but it needs two pages and the guy to press a button i would like it so as soon as they see the page it does the log is this possible heres the code i use at the momemnt
page 1 403 page
<html>
<head>
<title>403 Error Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="f8e5bb">
<?php
include("con.php");
$sql = "SELECT * FROM banlist order by ban_id ";
$sql_result = mysql_query($sql) or die(mysql_error());
if (!$sql_result) {
echo "<P>Couldn't get item!";
} else {
$row = mysql_fetch_array($sql_result);
$ban_id = $row["ban_id"];
$ban_ip = $row["ban_ip"];
$datefield= $row["datefield"];
}
echo" <FORM method=\"POST\" action=\"indexip.php\"> ";
echo"<p align=center><img src=\"logo.gif\" width=\"800\" height=\"100\"> </p>";
echo"<div align=\"center\"> ";
echo"<p> </p> ";
echo"<p align=\"center\"><b>Sorry </b></p>";
echo"<p align=\"center\"><b>You seem to have requested a page that is not available!</b></p>";
echo "<p align=center><tr>";
echo" <INPUT type=\"hidden\" name=\"ban_ip\" value=\"$REMOTE_ADDR\" size=8 maxlength=8></p></TD> ";
echo"</div><br>";
echo"</tr>";
echo" <p align=center><input type=\"submit\" value=\"Press here to Go back to FalconUK\"></p> <br><hr width=\"800\" size=\"10\" noshade color=\"#c5bcce\"> ";
?>
</body>
</html>
page two this is sort of hidden
<html>
<head>
<title></title>
</head>
<body>
<?
$sql = "INSERT INTO banlist VALUES ('$ban_id', '$ban_ip', now())";
include("con.php");
$sql_result = mysql_query($sql) or die(mysql_error());
if (!$sql_result) {
echo "<P>Couldn't modify record!</p>";
} else {
echo "<META HTTP-EQUIV=\"Refresh\" Content=\"0; URL=index.php\">";
}
?>
</body>
</html>