Selected Radio button in email

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
flacooo
Forum Newbie
Posts: 2
Joined: Fri Jul 29, 2005 10:56 am

Selected Radio button in email

Post by flacooo »

Hey all,

If you have a radio group in a HTML form and you would like to get only the selected radio button into the email that is generated, is there a chunk of code that can be placed inside the mail() or how would one go about doing something like this?

Thanks!
Jeff
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

if you want to include radio buttons in your email, you're going to have to use HTML in your email.

search this forum for HTML and email and you'll find all the answers you need about how to include the correct headers in your email for HTML.

then to put the radio button in your email, you'll just use standard HTML formatting for the "body" part of your email message...
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

If you have a bunch of radio buttons, give them all the same name. Then, when the form is submitted, only the one that's checked off will be POSTed. Then just send that value in the email.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
flacooo
Forum Newbie
Posts: 2
Joined: Fri Jul 29, 2005 10:56 am

Post by flacooo »

Thank you very much for the input. I will give it a go!
Post Reply