note 37255 added to faq
| From: | aryanj at hotmail dot com | Date: | Fri, 07 Nov 2003 16:43:37 +0000 |
| Subject: | note 37255 added to faq | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60103@lists.php.net to get a copy of this message | ||
I do not have much experience in PHP.I try to set a cookie in my script. I have two tables. One is
sorted by "studios" and the other one sorted by "sessiontime".
There is one variable that defines which table has to be shown on the screen. The default table is
the one which is sorted by sessiontime. What I want is to leave the page when the table is sorted by
studios and when I open a new browser see the table which is sorted by studios and not the default
one.
I think that I have to put array "setcookie" on the top of my script:
setcookie ("cookie[session]", "cookiesession", time()+24 * 60 * 60);
setcookie ("cookie[studio]", "cookiestudio", time()+24 * 60 * 60);
if (isset ($cookie)) {
while (list ($name, $value) = each ($cookie)) {
echo "$name == $value<br>\n";
}
}
And then have to call the cookie somewhere in the tables:
$_cookie[$cookie[session]]; //in the sessiontime table
$_cookie[$cookie[studio]]; //in the studio table
This seems not to work. I see that one cookie has been created, but every time I open a new browser,
I just see the default table on the screen. Does anyone know what the problem could be?
Thanks
Aryan
----
Manual Page -- http://www.php.net/manual/en/faq.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37255
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37255&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37255&report=yes
Search -- http://master.php.net/manage/user-notes.php