You are here: RE: [PHP] A more ecconomical way with control statements?? « PHP « IT news, forums, messages
RE: [PHP] A more ecconomical way with control statements??

Posted by Stanislav Kuhn on 03/07/05 15:06

in the form:
....
<input type=text name=cookie_vars[samosa]>
<input type=text name=cookie_vars[pakora]>
....

in the script
....
foreach($_REQUEST['cookie_vars'] $var_name as $var_val)
if (!empty($var))
setcookie("cookie[$var_name]", "$var_val");
....

Stan

-----Original Message-----
From: Ross Hulford [mailto:ross@aztechost.com]
Sent: 07 March 2005 12:59
To: php-general@lists.php.net
Subject: [PHP] A more ecconomical way with control statements??


if (empty($samosa)){
// do nothing

}

else {

setcookie("cookie[samosa]", "$samosa");

}


if (empty($pakora)){
// do nothing

}

else {

setcookie("cookie[pakora]", "$pakora");

}


It goes on like this for the whole menu I am looking for a more effiecient
way to do this. The inputs are text boxes taking values from 0-9.

Thanks



Ross

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация