|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Check Boxes Array PHP HELP !
Okay here is what I have so far, and this is the error that I get.
Warning: Invalid argument supplied for foreach() in /usr/home/dave/www/signrequest.php3 on line 25 IF ANYONE CAN HELP I WOULD BE MOST APPRECIATIVE /* This is my webform for the checkbox array */ 4. Will the piece be: (check all that apply): </font></P> <INPUT type=checkbox value="Mailed" name="pieces[]"> <FONT size=2>Mailed </FONT> <INPUT type=checkbox value="Displayed" name="pieces[]"> <FONT size=2>Displayed </FONT> <INPUT type=checkbox value="Photocopied" name="pieces[]"> <FONT size=2>Photocopied </FONT> <INPUT type=checkbox value="Faxed" name="pieces[]"> <FONT size=2>Faxed </FONT> <INPUT type=checkbox value="Faxed" name="pieces[]"> <FONT size=2>Emailed</FONT></td></tr> /*This is my array loop in the php script */ foreach ($pieces as $Mods) { $piece.=$Mods . "\n\t\t "; } /*My hope is that the values from the loop above will compund in this value "$piece" . I cannot use the "print" command or "echo" command as I have a seen in quite a few examples as this is being emailed in a message*/ 4. Will this piece be: $piece Thanks. |
|
#2
|
|||
|
|||
|
not sure here? perhaps an array???
|
|
#3
|
|||
|
|||
|
Quote:
Your "$pieces" array is empty or a scalar. hth, M.
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#4
|
||||
|
||||
|
If you have register_globals disabled in PHP, you'll need to access 'pieces' from the superglobal corresponding to the form's method (i.e., from $_GET or $_POST, depending on if the form is using method='get' or method='post').
Since we dont' know the method, try using $_REQUEST['pieces'] in your foreach() loop.
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Check Boxes Array PHP HELP ! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|