hello again i wanna know how can i protect example test.php from user that cannot enter twice on test.php during 1 hour? anyone know how it works ?
untested:
<?PHP if (isset($_COOKIE['login'])) { exit ("You can only login once per hour"); } else { setcookie ("login", true , time()+3600); }
i mean something like this but i dont know how it works
IF ($cookie == 1) { include my site here } IF ($cookie == 2) { die "u cant join this site twice"; }
I would just do something like this, as die() will stop the processing of the page:
if ($cookie == 2) { //$cookie should probably be $_COOKIE['cookiename']; unless you set up the $cookie var earlier die ("u cant join this site twice"); }