How to display a one-time popup ad

I'd like to know how this popup ad was created/displayed.

Also, how can I make sure that a visitor only sees it once when they hit my homepage?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

<%if session("popup") <> "no" then
session("popup") = "no"
<%end if%>
That will only displaty the popup once, based on session variable.
You could also set a cookie, if you like.  Set a cookie on the users PC, so when that user visits your site again, you will check for the cookie.  If it is there, don't show the popup.

Kind of the same as alorentz commented, but using a cookie instead.

This example creates a cookie that counts the number of times each person has visited your site. It will also expire in 10 days from thier last visit.


response.cookies("popup").Expires = date + 10
if num = "" then
      response.cookies("popup") = 1
      response.cookies("popup") = num + 1
end if

if response.cookies("popup") < 1 then
response.cookies("popup") = "no"
<%end if%>

This way, they will see the popup again after 10 visits to your site...or whatever number you set.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.