ok , no problems
// this code create table ..
CREATE TABLE `snake_php` (
`id` int(11) NOT NULL auto_increment,
`ref` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
connect to the database .. save (config.php)
<?
$date = "database_name";
$pass = "";
$user = "root";
$server = "localhost";
$link = mysql_connect($server,$usre,$pass) or die (mysql_error());
mysql_select_db($data);
?>
now save this code in save_ref.php , and include this file ( save_ref.php) in you home page ( index.php ) ..
<?
include(" config.php ");
// get referrer
$ref = $_SERVER['HTTP_REFERER'];
$SQL = mysql_query(" SELECT * FROM snake_php WHERE ref='".$ref."' ") or die (mysql_error());
$info = mysql_fetch_array($SQL);
if(! $info[ref] ){
$SQL = mysql_query(" insert into snake_php set ref='".$ref."' ");
}
?>
when you need to view All referrer show this
http://www.XXX.com/show.php
save this code in show.php
<?
include(" config.php");
$SQL = mysql_query(" select * from snake_php order by id desc ") or die (mysql_error());
ECHO " This Is All Refrerer To you Site : ";
while($row = mysql_fetch_array($SQL))
{
ECHO "- <a href='$row[ref]'>".$row[ref]."</a><br>";
}
?>
welcome