<?php
$id=intval($_GET["id"]);
require ("inc/connect.inc.php");
$sql=mysql_query("select * from ".$db_pref."banners where id='$id'");
$row=mysql_fetch_array($sql);
$num=$row['ad'];
$url=$row["url"];
if ($plus = $num + 1) {
mysql_query("update ".$db_pref."banners set ad='$plus' where id='$id'");
header ("Location: $url");
}
?>