<? if ((isset($_GET['link'])) AND (preg_match( '|^[\d]*$|D' ,$_GET['link']))) {
$link=intval($_GET['link']);
require('config.php');
$sql = "SELECT * FROM tb_frameads WHERE id='$link' ";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$urll=$row['link'];
$url="$urll";
$queryb = "UPDATE tb_frameads SET clicks=clicks+1 WHERE link='$url'";mysql_query($queryb) or die(mysql_error());
header ("Location: $url"); } ?>