Log IP to Database
I found this today,
I ran this query on my Wordpress database.
CREATE TABLE `ip` (
`id` int(5) NOT NULL auto_increment,
`ip` varchar(50) NOT NULL default ”,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
And placed this php code in my footer.
<?php
$ip = $_SERVER[’REMOTE_ADDR’];
$sql = “INSERT INTO `ip` ( `id` , `ip` ) VALUES ( ”, ‘$ip’)”;
$query = mysql_query($sql);
print “Logged: $ip”;
?>
I just like having IP’s logged in my database forever. Maybe you’ll find that handy.



November 4th, 2006 at 4:53 am
[…] Wordpress Themes/Skins » Log IP to Database (tags: wordpress) […]
December 9th, 2006 at 11:19 am
Dear Kalina,
I love your web design. It is rich and vibrant.
Lana