...

View Full Version : IP logging script



xhispage
11-20-2003, 07:49 AM
Is there a script that logs the ip's of visitors that go to the admin login page of my website??? SO i can see what IP's dont mach mine , and then I can ban them??? Something that saves all ip's to a.txt file or sends it by mail or something... Please help.

Xanni

Scrowler
11-20-2003, 09:29 AM
<?
mysql_connect("localhost","username""pass");
mysql_select_db("dbname");

$ip = $_SERVER['REMOTE_ADDR'];
mysql_query("INSERT INTO IpLogs (Ip) VALUES ('$ip')") or die(mysql_error());
echo '<br>IP logged.';
?>

this will log the visitor's ip address into a table named ip into a column named ip.

xhispage
11-20-2003, 12:57 PM
thank you very much , just what I needed! :thumbsup:

Xanni

Scrowler
11-21-2003, 04:36 AM
yw

yamaharider848
07-14-2008, 07:35 AM
<?
mysql_connect("localhost","username""pass");
mysql_select_db("dbname");

$ip = $_SERVER['REMOTE_ADDR'];
mysql_query("INSERT INTO IpLogs (Ip) VALUES ('$ip')") or die(mysql_error());
echo '<br>IP logged.';
?>

this will log the visitor's ip address into a table named ip into a column named ip.








do i put this into my webpage jest like that and save it and bam could someone explain -noob i guess

_Aerospace_Eng_
07-14-2008, 08:38 AM
Your server needs to support php. You also need to have a mysql database available to you. Once you have that and have the login details to the database you can create the table you need to store them. This isn't easy for a beginner. I suggest you do some php/mysql tutorials if you want to use something like this.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum