
December 17th, 2003, 05:24 PM
|
|
Moderator
|
|
Join Date: Apr 2002
Posts: 404
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
|
|
|
Remembering Last Visits
PHP Code:
<?
//script to determine your last visit to my site
if (isset($_COOKIE['last_visited'])) {
$last = $_COOKIE['last_visited'];
if (date('z') == date('z', $last)) {
$lastVisitStr = 'You last visited ' . date('Today, h:i:s A ', $last);
} else {
$lastVisitStr = 'You last visited ' . date('l, j. F', $last);
}
} else {
$lastVisitStr = 'Welcome, This is your first visit';
}
setcookie('last_visited', time(), time() + 3600 * 24 * 365);
?>
<?
// later on in your script you can echo $lastVisitStr
echo $lastVisitStr
?>
ok i got the script working, it remembers when you were last at the site and all, but now i want to make the script better but i don't know how.
ok i want it to remember the date you were last there like this you were here last here at the particular month followed by the date and then the year, and i would like to have the time part of this script removed unless it be turned into military time.
so can someone help me out here 
__________________
Apache Expert
|