page_id]){ setcookie('startspin_' . $getThis->page_id,'1',time()+60*60, '/', ''); $ref = $_SERVER['HTTP_REFERER']; if(strpos($ref, 'google')){ $string = @stristr($ref, 'q='); $keywords = @explode('&',$string); $keywords = @str_replace('q=','',$keywords[0]); $_SESSION['S_keywords'] = $keywords; } $sqlSE = mysql_query("SELECT * FROM ipname WHERE ip = '" . $REMOTE_ADDR . "'") or die(mysql_error()); if($getSE = mysql_fetch_object($sqlSE)){ $sqlInsert = "INSERT INTO iptrackse (ip, time, page_id, cat) VALUES ('" . $REMOTE_ADDR . "', '" . time() . "', '" . $getThis->page_id . "', '" . $cid . "')"; mysql_query($sqlInsert) or die(mysql_error()); } else { $sqlInsert = "INSERT INTO iptracker (ip, time, page_id, cat, ref, page) VALUES ('" . $REMOTE_ADDR . "', '" . time() . "', '" . $getThis->page_id . "', '" . $cid . "', '" . $ref . "', '" . $PHP_SELF . "')"; mysql_query($sqlInsert) or die(mysql_error()); $sqlUpdate = "UPDATE pages SET page_hits = (page_hits + 1) WHERE page_id = '" . $getThis->page_id . "' LIMIT 1"; mysql_query($sqlUpdate) or die(mysql_error()); } } include('page.php'); } else { include('main.php'); } } else { include('main.php'); } echo $_SESSION['S_keywords']; ?>