Setting a cookie using PHP
<?php
$expire=time()+60*60*24*30;
setcookie(“user”,”Balu”, $expire);
?>
<html></html>
Retrieve a cookie using php
<html>
<body>
<?php
if (isset($_COOKIE["user"]))
echo “Welcome ” . $_COOKIE["user"] . “!<br />”;
else
echo “Welcome guest!<br />”;
?>
</body>
</html>
Very simple is it….enjoy!!!!!!!!!!!!!!
Incoming search terms:
You will also be interested in ,
- Add rounded edge or corner images using php
- Database Connection And Pagination In PHP Using Symfony Framework
- Mysql backup via cron using php and email the file
- Simple PHP Login Script
- Enabling curl on XAMPP for Windows
- HTML E-mail Using PHP
- How To Set And Get Cookies Using PHP
- How to avoid direct access to a file in php
- How to create random passwords using php
- Extract domain name from url using php
