Return to Snippet

Revision: 61788
at January 15, 2013 21:37 by kameshsoft


Initial Code
<?php 
/*
If you have doubt please ontact me : [email protected]
*/
function cookie($name , $val = null , $exp = 0){
if($val == null) return $_COOKIE[$name];
else{
return setcookie($name, $val , $exp);
}
}
?>

Initial URL
http://ksoft.is-great.org

Initial Description
To set cookie use "cookie('name of your cookie','cookie data','expire date ')" it will set your cookie in the user browser .
To get the saved cookie use "cookie('name of your cookie')" it will give you the value of the cookie which you saved in the user's browser .

Initial Title
Advanced cookie function with php

Initial Tags
php, function

Initial Language
PHP