Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 1st, 2003, 11:55 PM
drummel drummel is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 drummel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.&nbsp;Will the piece be: (check all that apply):
</font></P>
<INPUT type=checkbox value="Mailed" name="pieces[]">&nbsp;
<FONT size=2>Mailed&nbsp;&nbsp; </FONT>
<INPUT type=checkbox value="Displayed" name="pieces[]">
<FONT size=2>Displayed&nbsp;&nbsp;</FONT>&nbsp;
<INPUT type=checkbox value="Photocopied" name="pieces[]">&nbsp;
<FONT size=2>Photocopied&nbsp;&nbsp; &nbsp; </FONT>
<INPUT type=checkbox value="Faxed" name="pieces[]">&nbsp;
<FONT size=2>Faxed&nbsp;&nbsp; &nbsp; </FONT>
<INPUT type=checkbox value="Faxed" name="pieces[]">&nbsp;
<FONT size=2>Emailed</FONT></td></tr>&nbsp;



/*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.

Reply With Quote
  #2  
Old December 2nd, 2003, 03:52 PM
galore galore is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: newcastle-upon-tyne, england
Posts: 56 galore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via MSN to galore Send a message via Yahoo to galore
not sure here? perhaps an array???

Reply With Quote
  #3  
Old December 5th, 2003, 08:22 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 185
Quote:
Warning: Invalid argument supplied for foreach() in /usr/home/dave/www/signrequest.php3 on line 25

Your "$pieces" array is empty or a scalar.

hth,
M.
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #4  
Old December 6th, 2003, 11:43 AM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,225 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 44 m 44 sec
Reputation Power: 174
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


Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Check Boxes Array PHP HELP !


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT