xyn Posted June 28, 2006 Share Posted June 28, 2006 Hii,I've been trying to make a sort of hit counter with MYSQL i've tried to set a cookie which is timed for about 1 month however There is either a problem setting the cookie or viewing the cookie. It's like a hit coutner to see how many hits come [b]IN [/b]and [b]OUT [/b]of my website.Below is my code:[code]if(!isset($_COOKIE['vibein'])){setcookie("vibein", vibein, time() + (29 * 23 * 59 * 60) , "/affiliate/", zroxx.com, FALSE);include("db.php");$result = mysql_query("SELECT * FROM stats WHERE id='1'");while($indata = mysql_fetch_row($result)){$inn = $indata[2];}$total = $inn+1;include "db.php";$db = mysql_connect("localhost", $login, $pwd) or die(mysql_error());mysql_select_db("zroxxco_affiliate") or die(mysql_error());$query = "UPDATE `stats` SET `in` = '$total' WHERE `id`='1'" or die(mysql_error());$result = mysql_query($query, $db) or die(mysql_error());echo '<html><head><meta http-equiv="Content-Language" content="en-gb"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><META HTTP-EQUIV="REFRESH" CONTENT="3;URL=URL_HERE"><title>Re-directing...</title></head>';}else{echo '<html><head><meta http-equiv="Content-Language" content="en-gb"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><META HTTP-EQUIV="REFRESH" CONTENT="3;URL=URL_HERE"><title>Re-directing...</title></head>';}[/code] Link to comment https://forums.phpfreaks.com/topic/13122-cookies-problems/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.