Reply to Cookie-question?

Your name:

Reply:


Posted by "Gustav Wiberg" on 09/07/05 16:39

Hi there!

Look at following code below, and please give me a clue why this
cookie-thing doesn't work?
$IDJoke is set before and is an ID from a row in a db
It seems to work a while, but is there a limit for the expire-parameter?

/G
http://www.varupiraten.se/


//Get cookie from users computer for current joke to tell if user is
allowed to vote or not!
//
$cookieJoke = $HTTP_COOKIE_VARS["$IDJoke"];
if ($cookieJoke == 'voted') {$showVoteValues ='N';$userVote = 'N';}

//User wants to vote?
//
if ($voteNow == 'Y' AND $userVote == 'Y' AND $cookieJoke != 'voted') {

$showVoteValues = 'N'; //Don't show values directly after
vote...

//Save IDJoke to a cookie with the value - voted to users
computer
setcookie("$IDJoke", 'voted', time()+60*60*24*30*12*100); /*
expires in about 100 years*/

//END User wants to vote
//
}

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация