(U) RE: [PHP-DB] Cookie problem
| From: | Holmes, John W 1 LT | Date: | Wed, 27 Dec 2000 23:58:53 +0000 |
| Subject: | (U) RE: [PHP-DB] Cookie problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-5466@lists.php.net to get a copy of this message | ||
CLASSIFICATION: UNCLASSIFIED
I think this will work. Read the manual on Variable Variables...
$var = "votecookie" . $row[0] . $row[6];
$($var) = true;
You can now use $votecookie06, or whatever the numbers are.
I don't know if having all of these variables is the best way to do things,
though...not sure what you're doing...
---John Holmes...
-----Original Message-----
From: Mattias Johansson [mailto:smart@smartsmartsmart.com]
Sent: Thursday, December 28, 2000 6:17 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Cookie problem
Okay, I need help again... Here goes:
I used a loop to set the cookie name to "votecookie".$row[0].$row[6] - that
works fine, I now have a lot of cookies called votecookie111, votecookie121,
votecookie131 and so on.
My problems are two.
1. How do I change the cookie variable? The cookie setting must be variable
based, since it is in a loop. I.e. I cant set it like:
$votecookie121 = true
I must use something like:
$."votecookie".$row[0].$row[6] = true
The above is an invalid command, but if it worked it would be perfect.
2. I need to use an IF to check if the cookie is = true. The same problem
applies as above, I think.
I must say that PHP is a very nice language - I started learning it just a
few days, and I already know it a little. Cool. Please help me out on this
one, though, before I explode and die.
/Mattias
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
Classification: UNCLASSIFIED