RE: [PHP] status Check boxes in PHP3
| From: | Maxim Maletsky | Date: | Wed, 06 Sep 2000 10:47:07 +0000 |
| Subject: | RE: [PHP] status Check boxes in PHP3 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15487@lists.php.net to get a copy of this message | ||
I am currently working on script and I use somewhere in it a similar
thing...
the code is not really available right now but the idea is the following:
in your database you need at least one field that contains the value of a
checkbox.
let's say 1 is submitted, 'NULL' is not...
when you then output your checkboxes use a while loop,\
and if the field's value to check or uncheck it..
while($v_mysql->fetch_record()) //peace of my code, sorry I use a class for
mysql...
{
if ($db['status'])
$status =' checked';
else
$status ='';
echo '<input type="checkbox" name="name"
value="'.$db['value'].$status.'> ".$db['name']."<br>";
}
-----Original Message-----
From: manoj nahar [mailto:manoj@igtechnologies.com]
Sent: Wednesday, September 06, 2000 7:08 PM
To: php-general@lists.php.net
Subject: [PHP] staus Check boxes in PHP3
hi
Please help me out with this.
i am taking the values of series of checkboxes from database and giving
them values as 1 for enable and
status of check box is checked and 0 means the check boxes is unchecked.
now when the form is submitted after the user has changed the status from
checked-> uncheked and vice versa.
now how can i get the status of checkbox as checked and value so that i can
update my database.
in short i have to iterate through all the check boxes and update the value
to database.
please help me out with this and if possible some code please.
manoj nahar
IG Technologies Limited , Mumbai
Tel* 91-22-7611314/ 7904285
Fax* 91-22-7611315
http://www.igtechnologies.com
**************************************************************************
DISCLAIMER
***************************************************************************
Any content of this e-mail shall not be disclosed to or
used by anyone other than the addressee(s), nor copied
in any way. If received in error, Please delete it and advice
the sender immediately.The contents of the e-mail is not
controlled by IG Technologies Limited.
----------------------------------------------------------------------------
--------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net