1. Home
  2. Computing & Technology
  3. PHP / MySQL

You Last Visited PHP Script

By , About.com Guide

4 of 4

New Users

else
{
echo "Welcome to our site!";
//Greets a first time user
}
?>
If $last did not exist, then this code executes. It simply welcomes a first time user to the site. They now have a cookie set in their browser so they will not get this message again.

The top part of the script, that retrieves and sets the cookie, needs to be placed at the very top of a page to work. The rest of this script can run anywhere on your site that you want to welcome a user.

Explore PHP / MySQL
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Step By Steps
  5. Your Last Visit Script - PHP Last Visit Script - Last Time Visited PHP

©2009 About.com, a part of The New York Times Company.

All rights reserved.