Forum Moderators: coopster
<?
$id=$_GET['id'];
//Adds to the click count for a particular link
mysql_query("UPDATE uniquehits SET click = click +1 WHERE id = '$id'");
//Retrieves information
$dat = mysql_query("SELECT * FROM uniquehits WHERE id = '$id'") or die(mysql_error());
$r = mysql_fetch_array($data);
//redirects them to the link they clicked
header('Location: '".$r['website'] . "');
?>
[edited by: dreamcatcher at 7:08 am (utc) on May 28, 2010]
[edit reason] Use example.com, thank you [/edit]
[edited by: Matthew1980 at 7:16 am (utc) on May 28, 2010]
//Retrieves information
$sql = "SELECT website FROM uniquehits WHERE id=$id";
$query = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($query);
$website = $row["website"];
//redirects them to the link they clicked
header( "Location:" .$row['website'] );