note 106975 added to function.setcookie
| From: | h0mayun at yahoo dot com | Date: | Thu, 22 Dec 2011 13:46:39 +0000 |
| Subject: | note 106975 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185205@lists.php.net to get a copy of this message | ||
Cool Example too set background color for user
<?php
if (isset($_COOKIE["bg"]))
{
echo '<div
style="background-color:'.$_COOKIE["bg"].'">WORKED</div>';
echo 'background-color has been set to: <font
color="'.$_COOKIE["bg"].'">'.$_COOKIE["bg"].'</font>';
}else
{
setcookie("bg", $_POST['bgcolor'], time()+100);
?>
background-color is not set
<br />
Choose it:
<form method="post">
<select name="bgcolor">
<option value="red">red</option>
<option value="blue">blue</option>
<option value="green">green</option>
<option value="yellow">yellow</option>
</select>
<input type="submit" />
</form>
<?php
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 91.200.233.133
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- https://master.php.net/note/edit/106975
Del: integrated -- https://master.php.net/note/delete/106975/integrated
Del: useless -- https://master.php.net/note/delete/106975/useless
Del: bad code -- https://master.php.net/note/delete/106975/bad+code
Del: spam -- https://master.php.net/note/delete/106975/spam
Del: non-english -- https://master.php.net/note/delete/106975/non-english
Del: in docs -- https://master.php.net/note/delete/106975/in+docs
Del: other reasons-- https://master.php.net/note/delete/106975
Reject -- https://master.php.net/note/reject/106975
Search -- https://master.php.net/manage/user-notes.php