GetDotted Domains

Viewing Thread:
"PHP Help"

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.

Mon 03/09/01 at 00:07
Regular
Posts: 787
Hiya,

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).
Mon 03/09/01 at 00:07
Regular
"It goes so quickly"
Posts: 4,083
Hiya,

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).
Mon 03/09/01 at 13:05
Regular
"hockeyphotos.com"
Posts: 84
The data is normally available as a comma-delimited list.

Chris.
Tue 04/09/01 at 20:57
Regular
"Eff, you see, kay?"
Posts: 14,156
Erm, from memory I think multiple items of the same name get stored as an array.
Tue 04/09/01 at 21:48
Regular
"whoneedsatagline?"
Posts: 194
In a 'contact us' form I used a selection list (extract from HTML follows):

...

...

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.
Tue 04/09/01 at 22:37
Regular
"It goes so quickly"
Posts: 4,083
Thanx for your help people... I'll go try it out :o)
Thu 06/09/01 at 00:29
Regular
"whoneedsatagline?"
Posts: 194
You may already have been to www.phpbuilder.com, which has several useful news groups and articles. I've picked up some useful stuff on PHP from there.
Thu 06/09/01 at 09:05
Regular
Posts: 612
Also try www.php.net

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Unrivalled services
Freeola has to be one of, if not the best, ISP around as the services they offer seem unrivalled.
Impressive control panel
I have to say that I'm impressed with the features available having logged on... Loads of info - excellent.
Phil

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.