[PHP-DB] (U) RE: [PHP-DB] Cookie problem From: Holmes, John W 1 LT (HolmesJW <email protected>)
Date: 12/27/00

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 <email protected>]
Sent: Thursday, December 28, 2000 6:17 AM
To: php-db <email protected>
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 <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>

Classification: UNCLASSIFIED

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>