Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to add a cookie?

Answer Posted / rupali

bool setcookie ( string $name [, string $value [, int
$expire [, string $path [, string $domain [, bool $secure
[, bool $httponly ]]]]]] )
for e.g.
<?php
$value = 'something from somewhere';

setcookie("TestCookie", $value);
setcookie("TestCookie", $value, time()+3600); /* expire in
1 hour */
setcookie("TestCookie", $value, time()
+3600, "/~rasmus/", ".example.com", 1);
?>

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What kind of things have you done on the social side?

9018


How do you measure variables?

1049


Why many companies are switching their current business language to php? Where php basically used?

947


How to avoid the undefined index error?

991


What is meant by public, private, protected, static and final scopes?

1039


Differences between get and post methods?

1038


What is interface? Why it is used?

1031


What is the sign to start variables in PHP?

1093


What is rest api in php?

950


How to retrieve values out of an array?

1042


Can php replace javascript?

991


How to add comments in php?

998


What is a php 5?

1071


Difference between $message vs. $$Message in php.

993


How to break a file path name into parts?

974