View file users/go.php
<? include('../core/core.php'); $url = htmlspecialchars($_GET['url']); $rec = mysql_query("select * from `reclama` WHERE name = '$url';"); $rec = mysql_fetch_assoc($rec); if($url == NULL){ header("Location: /"); } else { if($rec['real_count'] < $rec['max_count']){ mysql_query("UPDATE `reclama` SET `real_count`=`real_count` + 1 WHERE name = '".$url."'"); header("Location: ".$rec['link'].""); } else { header("Location: /"); } } ?>