<?php include "../inc/conn.php";?>
<?php
if(!is_numeric($_GET["id"]) or empty($_GET['id'])){
exit;
}
if(empty($_GET['idd'])){
exit;
}
switch ((int)$_GET['idd']){
case 1: 
$db=$data['pro2'];
break;
case 2: 
$db=$data['news'];
break;
//
default:
$db=$data['news'];
break;
}
$id=$_GET["id"];
@mysql_query("update ".$db." set hits=hits+1 where id='$id' and passed=1 ");
$sql="select * from ".$db." where id='$id'";
					  $result=query($sql);
					  $res=fetch($result);
					  if (isrecord($result)==true){
					  echo "document.write('".$res['hits']."');";
					  }
 ?>