<?php
	require dirname(__FILE__).'/include/common.inc.php';
	$db->query("UPDATE ".DB_PRE."ads SET clicks=clicks+1 WHERE id=".intval($id),true);
	$r=$db->fetch_one("SELECT linkurl FROM ".DB_PRE."ads WHERE id=".intval($id));
	header("location:".$r['linkurl']);
	unset($r);
	exit();
?>