Forum Moderators: coopster
Here is how I currently set my bandwidth cookie...
<?php setcookie("bandwidth","4",time()+2592000,"/");?>
<?php
if(!isset($_COOKIE["bandwidth"]) setcookie("bandwidth", "1", time() + 2592000, "/"); //first appearance
else
{
$cookie = (int)$_COOKIE["bandwidth"] + 1; //increase the transformed to (int) cookie
setcookie("bandwidth", $cookie, time()+2592000, "/"); //set the increased cookie
}?>
I think this should do, however I haven't tested it myself.
Best wishes
Michal Cibor
<?php
if(!isset($_COOKIE["bandwidth"]))
{
setcookie("bandwidth", "1", time() + 2592000, "/"); //first appearance
} else {
$cookie = (int)$_COOKIE["bandwidth"] + 1; //increase the transformed to (int) cookie
setcookie("bandwidth", $cookie, time()+2592000, "/"); //set the increased cookie
}?>