Re: php form mail - checkbox problem

From: Date: Tue, 29 Oct 2002 15:12:34 +0000
Subject: Re: php form mail - checkbox problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-121864@lists.php.net to get a copy of this message
"Rick Emery" <remery@emeryloftus.com> wrote in message news:03f901c27f5a$2bab0e50$0500a8c0@honeybee... > What is $medlemskap[]??? ....? I just modified it from the default code: //Routine for checkboxes $MailBody .="Question 8 : "; $items = 3; //initiate possible # of items for ($i = 1; $i <= $items; $i++) { //loop on # of items $MailBody .= "$champ8[$i], "; //put results in variable MailBody } ----------- > You MUST refer to item_1[]. > Also, I believe you REALLY meant that all values be accessed through an array; therefore > the "name=" parameter in your HTML must all be the SAME name: > > <input type="checkbox" name="items[]" > value="hovedmedlemskap"> > hovedmedlemskap [200 kr.] > <input type="checkbox" name="items[]" value="2 i > husholdning"> > 2 eller flere i samme husholdning [100 kr.] Tried that, same same. Still not working :oO > ----- Original Message ----- > From: "Tine" <thaugen@optonline.net> > To: <> > Sent: Tuesday, October 29, 2002 8:34 AM > Subject: [PHP] php form mail - checkbox problem > > > Greetings, > > Forgive my newbism here, but I am having a hard time recieving check(box)ed > items from a form sent to e-mail using PHP. > > The code is as follows: > > //Routine for checkboxes > > $MailBody .="Type medlemskap : "; > > $items = 2; //initiate possible # of items > > for ($i = 1; $i <= $items; $i++) { //loop on # of items > > $MailBody .= "$medlemskap[$i], "; //put results in variable MailBody > } > > ..and the html code put in the form is: > > <input type="checkbox" name="item_1[]" > value="hovedmedlemskap"> > hovedmedlemskap [200 kr.] > <input type="checkbox" name="item_2[]" value="2 i > husholdning"> > 2 eller flere i samme husholdning [100 kr.] > > The problem is, when I recieve the form as email, it just shows the checked > item(s) as: ",," > (without the quotemarks) > > What am I doing wrong? I am using the script found here: > http://www.grenadine.net/php/NadForm/NadForm_en.html > > Website where my form is located is here: > http://komposlo.inmono.net/m_skap.html > > Help is very much appreciated! > > Thanks in advance, > Tine > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.general (#121864) next »