can I do a for each here??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have about 10 text boxes each taking in value (ages) , The code I have 
checks for a value and if it is set it then sets the cookie to that value. 
The else just clears the value. On the next page I use a foreach to get the 
values but I think there must be a quicker way to collect the data appart 
from 10 if-else staements.

if (isset($andrea){

setcookie("cookie[andrea]", "$andrea");
}

else {setcookie("cookie[$andrea]", "");

}


if (isset($james){

setcookie("cookie[james]", "$james");
}

else {setcookie("cookie[$james]", "");

}


AD 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux