note 11544 added to Control Structures

From: Date: Fri, 23 Feb 2001 22:04:00 +0000
Subject: note 11544 added to Control Structures
Groups: php.notes 
Request: Send a blank email to php-notes+get-11506@lists.php.net to get a copy of this message
Greetings, I am attempting to add a javascript popup to my site, but only on the original visit to the page. I have been attempting it with cookies, but I can't quite get the code right. Here is what I have right now: (in the popup) <? SetCookie("popup",$true,time()+900); ?> then, in the page: <? if($popup) { continue 2; } else{ ?> <javascript popup code> <? } ?> <rest of the page> Now, with that code, the popup appears every visit to the page. I think it has something to do with the continue, but I can't find any way to make it work. http://www.php.net/manual/en/control-structures.php

« previous php.notes (#11506) next »