Here's how to fix it
| From: | Chris Earle | Date: | Sun, 21 Jul 2002 23:04:47 +0000 |
| Subject: | Here's how to fix it | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108767@lists.php.net to get a copy of this message | ||
You have to use a FOR or WHILE loop. PHP 3 doesn't supported the foreach
loop.
You can get identical results by using the examples here:
http://www.php.net/manual/en/control-structures.foreach.php
"Dean Ouellette" <dean@ouellette.ws> wrote in message
news:000b01c230f5$7837aa70$9c89adac@yoda...
> I have a different host I use for my sites, this is one I took over, and
> they insist I use this hosting company, friend of an owner. Have been
> trying to get to switch but wont. So any ideas on how can get this to
> work, no text coming in email
>
> When I print_r($_POST) ((((what does that do?)))
> I get
print_r shows everything in the array on the screen.
> print_r($_POST)
> Fatal error: Call to unsupported or undefined function foreach() in
> /www/docs/www.electjoemarine.com/email.php on line 71
>
> > PHP Version 3.0.16
> > > <?
> > > $MailToAddress = "dean@email.com";
> > > $MailSubject = "Group volunteer list";
> > > if (!$MailFromAddress) {
> > > $MailFromAddress = "$email";
> > > }
> > > $Header = "";
> > > $Footer = "";
> > >
> > > foreach($_POST as $key => $val)
> > > {
> > > $val = stripslashes($val);
> > > $Message .= "$key = $val\n";
> > > }
> >
> > What do you see when you: print_r($_POST)
I believe it says "Array ( $whatevertheKEYis => $theVALUE, $nextKEY =>
$nextValue)" on screen for it. Basically, it makes it so you could copy and
paste it and create a replica of THAT array. Mostly used for debugging.