Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display welcome message to first-time visitors

Looking for a simple way to show a welcome message to first time visitors on my website. What's the best approach?

like image 607
ioannis Avatar asked Jun 20 '10 16:06

ioannis


People also ask

What is a good welcoming message?

We look forward to supporting you along the way.” “Congratulations on the new position, and many good wishes for your first day at [company name]. We want you to know that we believe in you and we're behind you in everything you do here.” “A warm welcome from the whole team here at [company].


1 Answers

Using a cookie:

if (empty($_COOKIE['first_time'])) {
    show_welcome_message();
    setcookie("first_time", 1, time()+157680000);  /* expire in 5 years */
}

Of course, if the users clears his cookies, he'll see the message again. If he doesn't accept cookies, he'll see the message all the time.

like image 87
Artefacto Avatar answered Oct 07 '22 18:10

Artefacto