The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I just wanted to know if anyone can help me with something in PHP when coming to HTML Forms. I know that to refer to a form's Input you just put the name of the Input box after a $ (like $Name $Age). But I'm stuck when it comes to multiple items, like list boxes or check boxes. In my PHP Book it says I can give each set the same name, but different values. Can anyone tell me how I'd use these, so I can ditermin in the Script which one was selected??
.. hope that made some sence...
Thanx in Advance :o).
I just wanted to know if anyone can help me with something in PHP when coming to HTML Forms. I know that to refer to a form's Input you just put the name of the Input box after a $ (like $Name $Age). But I'm stuck when it comes to multiple items, like list boxes or check boxes. In my PHP Book it says I can give each set the same name, but different values. Can anyone tell me how I'd use these, so I can ditermin in the Script which one was selected??
.. hope that made some sence...
Thanx in Advance :o).
Chris.
...
...
then in the php script that receives the form:
...
switch ($sendto) {
case "webmaster": $emailto = "[email protected]"; break;
case "secretary": $emailto = "[email protected]"; break;
case "swimsec": $emailto = "[email protected]"; break;
default: $emailto = "[email protected]"; break;
}
...
In other words, the variable takes on the value of the selected option. I think you can do the same for radio buttons, check boxes etc.
But Turbonutter's right too - you can use an array if you say 'select name="sendto()"' and then the values in that array will tell you what was selected / not.