Re: foreach()

From: Date: Wed, 08 Sep 2004 14:41:38 +0000
Subject: Re: foreach()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-196124@lists.php.net to get a copy of this message
Anthony Ritter wrote:
I get a: Warning: Invalid argument supplied for foreach() in c:\apache\htdocs\or_6.4.php on line 15 after submitting the form.
Hello Anthony! As long as you don't submit the form with a single option selected there will be no $_POST['lunch'], therefore foreach() won't be able to loop through it. Add the line print_r($_POST) to your code in order to see what actually happens if you hit the submit-button of your form. Daniel

« previous php.general (#196124) next »