Thanks for the response. So this is what I have come up with. It redirects based on $id (link format http://www.blah.com/link.php?id=1234) properly, but does not update the click_count table. Any ideas as to why not?
<?
include("functions.php");
if ($id == "") {
header("location:$site");
}
else {
mysql_connect($host,$user,$pass);
$result=mysql_db_query("$db", "SELECT url FROM $table WHERE ID='$id'") or die ("Couldn't open \"$db\" database. Please inform $email: ".mysql_error());
$row = mysql_fetch_array($result);
$url = $row["url"];
mysql_query("INSERT INTO click_count (day,id,raw,uni,time,ipnum) VALUES (NOW(),'$id','1','1',now(),'$REMOTE_ADDR'");
}
?>
<html>
<head>
<meta http-equiv="refresh" content="0;URL=<? echo "$url"; ?>">
</head>
<body bgcolor="#FFFFFF" link=#999999 vlink=#666666 alink=#000000 >
</body>
</html>