Quote Originally Posted by annie View Post
http://php.flashwebhost.com/annie/cookie.php

Code:
<?php
if (isset($_COOKIE['visitor_name'])) {
echo $_COOKIE['visitor_name'] . ', Welcome to Meritnation';
exit;
}

if (isset($_POST['visitor_name']) && strlen($_POST['visitor_name']) > 3) {
setcookie('visitor_name',$_POST['visitor_name'], time() + 18000);
echo 'Cookie Set. Close the browser. Revisit this page, I will remember your name';
} else {
 echo '
        What is your name ?
        <form method="post" action="">
        <input type="text" name="visitor_name">
        <button type="submit" name="submit">Enter Web Site</button>
        </form>
    ';
}
Nice script, working properly.