[PHP] Re: array + checkbox

2001-08-06 Thread James Holloway

Hi there Tijmen,

Firstly, change the input name from this:
voorraad
to this:
voorraad[]

then do something like:


?

echo Checked values are as follows:brbr;

for ($i = 0; $i  sizeof($voorraad); $i++) {
if (!empty($voorraad[$i])) {
echo $voorraad[$i];
}
}

?

James

Tijmen Hennink [EMAIL PROTECTED] wrote in message
001601c11e52$d328e9f0$80c2a8c0@PATRIJS2000">news:001601c11e52$d328e9f0$80c2a8c0@PATRIJS2000...
Hi All,

I've the following weird problem.
I have a form which contains an array with values of some checkboxes.
This is the HTML-part:
INPUT TYPE=checkbox name=voorraad checked
if checked or
INPUT TYPE=checkbox name=voorraad

Now I want to check which of the checkboxes are really checked.
So I've got the following PHP code:
  if(count($voorraad[1])0) {
echo VOORRAAD NEE;
}
else {
echo VOORRAAD JA;
}

I've tried it with isset($voorraad[1]), count, is_null($voorraad[1]) but all
the functions doesn't work.
Does anyone see what I'm doing wrong??

Met vriendelijke groet/with kind regards,

Tijmen Hennink

[EMAIL PROTECTED]
Medi@connect


Dit e-mail bericht is uitsluitend bestemd voor de geadresseerde(n).
Gebruik van deze informatie door andere dan de geadresseerde
is verboden.
Het is evenmin toegestaan om deze informatie openbaar te maken,
te vermenigvuldigen, te verspreiden of te verstrekken aan derden. Aan dit
bericht kunnen geen rechten worden ontleend.
Indien u dit mailtje heeft ontvangen terwijl het niet aan u gericht was,
reply richting mij en verwijder vervolgens de email en uitgeprinte versies
van dit mailtje.


This e-mail is intended for the use of the addressee(s) only and may
contain privileged, confidential, or proprietary information that is exempt
from disclosure under law.  If you have received this message in error,
please inform me promptly by reply e-mail, then delete the e-mail and
any printed copy.

Thank you.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: array + checkbox

2001-08-06 Thread Tijmen Hennink

Very weird but it works.
But it doesn't see any changes in the form.
Maybe the PHP is just fine but the HTML contains some shit.
Here is the part that I'm using to generate the form.
 if ($aanwezig == TRUE)
  echo(  TD WIDTH=50 ALIGN=CENTERINPUT
TYPE=checkbox name=voorraad[] checked/TD\n);
else
  echo(  TD WIDTH=50 ALIGN=CENTERINPUT
TYPE=checkbox name=voorraad[] /TD\n);
}
It seems that although I can unclick a checkbox it still is selected in the
HTML, strange isn't it?
Well, how do I generate HTML that PHP can use to determine whether a
selectbox is still checked or that is it no longer checked at all.

Tijmen
- Original Message -
From: James Holloway [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 06, 2001 12:04 PM
Subject: Re: array + checkbox


 Hi there Tijmen,

 Firstly, change the input name from this:
 voorraad
 to this:
 voorraad[]

 then do something like:


 ?

 echo Checked values are as follows:brbr;

 for ($i = 0; $i  sizeof($voorraad); $i++) {
 if (!empty($voorraad[$i])) {
 echo $voorraad[$i];
 }
 }

 ?

 James

 Tijmen Hennink [EMAIL PROTECTED] wrote in message
 001601c11e52$d328e9f0$80c2a8c0@PATRIJS2000">news:001601c11e52$d328e9f0$80c2a8c0@PATRIJS2000...
 Hi All,

 I've the following weird problem.
 I have a form which contains an array with values of some checkboxes.
 This is the HTML-part:
 INPUT TYPE=checkbox name=voorraad checked
 if checked or
 INPUT TYPE=checkbox name=voorraad

 Now I want to check which of the checkboxes are really checked.
 So I've got the following PHP code:
   if(count($voorraad[1])0) {
 echo VOORRAAD NEE;
 }
 else {
 echo VOORRAAD JA;
 }

 I've tried it with isset($voorraad[1]), count, is_null($voorraad[1]) but
all
 the functions doesn't work.
 Does anyone see what I'm doing wrong??

 Met vriendelijke groet/with kind regards,

 Tijmen Hennink
 --
--
 [EMAIL PROTECTED]
 Medi@connect
 --
--

 Dit e-mail bericht is uitsluitend bestemd voor de geadresseerde(n).
 Gebruik van deze informatie door andere dan de geadresseerde
 is verboden.
 Het is evenmin toegestaan om deze informatie openbaar te maken,
 te vermenigvuldigen, te verspreiden of te verstrekken aan derden. Aan dit
 bericht kunnen geen rechten worden ontleend.
 Indien u dit mailtje heeft ontvangen terwijl het niet aan u gericht was,
 reply richting mij en verwijder vervolgens de email en uitgeprinte versies
 van dit mailtje.



 This e-mail is intended for the use of the addressee(s) only and may
 contain privileged, confidential, or proprietary information that is
exempt
 from disclosure under law.  If you have received this message in error,
 please inform me promptly by reply e-mail, then delete the e-mail and
 any printed copy.

 Thank you.








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]