http://php.flashwebhost.com/sibichan...set_cookie.php
PHP Code:
<?php
if (isset($_COOKIE['memberName'])) {
echo 'Hi ! '. strtoupper($_COOKIE['memberName']) .', Welcome to Group.<br>(<a href=delete_cookie.php>Click here to delete cookie</a>)';
exit;
}
if (isset($_POST['memberName']) && strlen($_POST['memberName']) > 3) {
setcookie('memberName', $_POST['memberName'], time()+3600);
echo 'Cookie Set. Close the browser. Revisit this page, I will remember your name <br>(<a href=delete_cookie.php>Click here to delete cookie</a>)';
}else {
echo ' Enter your Name <form method="post" action=""> <input type="text" name="memberName"> <button type="submit" name="whatever">Enter Group</button> </form>
';
}
Bookmarks