For setting a cookie you will have to use the setcookie() function. The setcookie() function must appear before the <html> tag. The Syntax for this function will be
Code:
setcookie(name, value, expire, path, domain);
For you to understand better, I have provided an example that will create a cookie having cookie named "admin" and assign the value "Counter-T". I have also specified that the cookie should expire after one hour. Here is code for that :
Code:
<?php
setcookie("admin", "Counter-T", time()+3600);
?>
<html>
.....
Bookmarks