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.

Share

Can now add a shopping cart to your WordPress blog

Cool new plugin, WP e-Commerce allows you to add a shopping cart functionality to your WordPress powered blog. It comes with PayPal integrated. I was playing around with the plugin in my admin backend, it’s pretty simple, you just need to customize it to suit your needs.

Nice plugin, you’ll have to check it out and see if it suits your needs, not sure what you will sell on a blog, but I am sure you’ll come up with something.

Share