PDA

View Full Version : Guest Only Pop-Up


Stephan Whelan
01-23-2002, 09:10 AM
Hi,

I've just had one of my site sponsors in discussion and they want to run a competition where if a guest registers on the site, they are entered to win a T-Shirt during that month.

To aid in this, it would be great if someone could help me code up a pop-up that appears when a guest appears on the forums. There would be some criteria though (this can be done through JavaScript I believe):

Must only appear to guests
May only appear once during a 7 day period
Can appear no matter which page they enter the forums on (i.e. in a thread or frontpage)

Is this something people have any ideas on?

Thanks In Advance!

Admin
01-23-2002, 09:20 AM
The first and last criterions are very easy, but since guests are not registered, and thus don't have any record in the database except for their session (which disappear 15 minutes after they leave), you can't check to see if the pop up was already displayed for a guest in the last week.

Stephan Whelan
01-23-2002, 09:23 AM
Chen,

Thanks!

I suppose the only other way is to set a cookie via JS that is valid for 7 days. Hmmmm...

I suppose I could live with only being displayed once per session.

So I suppose the next question is if anyone can help me do it?

Thanks...

Admin
01-23-2002, 09:26 AM
You can set a cookie using PHP, it's easy, and you can easily use it (unless someone deletes their cookie because they really really really like pop-ups ;)).

Stephan Whelan
01-23-2002, 09:30 AM
Well, suppose that shows how much I really know about coding in PHP :D

Stephan Whelan
01-28-2002, 08:24 AM
Been away so haven't followed this up...

Anyone possibly be able to code this for me?

Thanks!!

cyrus
02-01-2002, 10:04 AM
i would like to see this too ... any progress on it ? :D

Stephan Whelan
02-04-2002, 10:41 AM
Nobody has replied i'm afraid - I know it's easy but I don't have the necessary skills to be able to do it :(