<?
include_once 'system/head.php';
$id = $_GET['id'];
if(isset($id)){
mysql_query("UPDATE ads SET `oute`=oute+1 WHERE `id`='$id' LIMIT 1");
if($user){mysql_query("UPDATE user SET `balans`=`balans`+'1' WHERE `id`='$user[id]' LIMIT 1");}
$q = mysql_query ("SELECT * FROM ads WHERE id='$id'");
while($row = @mysql_fetch_array($q)){
header('Location: '.$row['link']);
}
exit;
}
else { header('Location: index.xhtml'); exit;}
?>