Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Sorry if this is a stupid question, but I'm really struggling to get arrays
working in PHP for form submissions.
I've found a few tutorials which have the following form / submission pages:
// form.htmlCode: Select all
<form action="submit.php" method=POST>
Which pets do you have?<br>
<input type="checkbox" name=petsї] value="dog">Dog
<input type="checkbox" name=petsї] value="cat">Cat
<input type="checkbox" name=petsї] value="gorilla">Gorilla
<input type="submit" name="languages" value="Submit"><br>
</form>Code: Select all
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
print "You have the following pets ";
$number=count($pets);
for($a=0;$a<=$number;$a++){
echo $pets[$a];
}You have the following pets
Notice: Undefined variable: pets in
/var/www/html/marketing/drawings/submit.php on line 7
Notice: Undefined variable: pets in
/var/www/html/marketing/drawings/submit.php on line 9
WHY!?!
Thanks in advance.
Russell
patrikG | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]