include('config.php'); if(isset($_SESSION['login'])){ $dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`online`) AS `online` FROM `users` WHERE `login`='{$_SESSION['login']}'"); $data = mysql_fetch_object($dbres); } if(!isset($data->login)){ echo ""; exit; } $site2 = mysql_query("SELECT * FROM `surf` WHERE (`active` = '0' AND `points` >= `cpc`) AND `id` NOT IN (SELECT `site` FROM `surfed` WHERE `user`='{$data->id}') ORDER BY `cpc` DESC LIMIT 0, 1"); $ext = mysql_num_rows($site2); $site = mysql_fetch_object($site2); $nr2 = mysql_query("SELECT * FROM `surf` WHERE (`active` = '0' AND `points` >= `cpc`) AND `id` NOT IN (SELECT `site` FROM `surfed` WHERE `user`='{$data->id}')"); $nr = mysql_num_rows($nr2); ?>