是的,你可以用PHP来实现。
// If you have already tables then ignore it otherwise "CREATE TABLE"
CREATE TABLE `yourpage` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`page` text NOT NULL,
`userip` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
// If you have already tables then ignore it otherwise "CREATE TABLE"
CREATE TABLE `yourviewer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`page` text NOT NULL,
`totalvisit` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
//Here is your code area.
$visiter_ip_address=$_SERVER['REMOTE_ADDR']; //Return user ip address.
$check_ip = mysql_query("select userip from yourpage where page='yourpage' and userip='$visiter_ip_address'");
if(mysql_num_rows($check_ip)>=1)
{
}
else
{
$insertview = mysql_query("insert into yourpage values('','yourpage','$visiter_ip_address')");
$updateview = mysql_query("update yourviewer set totalvisit = totalvisit+1 where page='yourpage' ");
}
//select tottal visitor from your page
$total_visitor = mysql_query("select totalvisit from yourviewer where page='yourpage' ");
echo '
'.'This page is viewed'. mysql_num_rows($total_visitor).' times'.'
';?>