Jump to content

How to use a radio button in php


Blekk

Recommended Posts

Hi,

In my form, the user is logged in, there is a "send to email address?" checkbox, if checked it sends to their email...obviously (the email address is in the users record in the database). But now I want to make this selection into two Radio Buttons, one for "send to email address?" and "send to different email address?" with a textbox underneath.

What I would like to know is how to retrieve data from two radio buttons say $radio1 and $radio2, I tried the checkbox way of:

[code]if(isset($_POST['radio1']));
{
print "radio1 was selected";
}

if(isset($_POST['radio2']));
{
print "radio2 was selected";
}[/code]

But this meant that I could select both radio buttons at the same time, not what I am looking for.

Is it something like a select box? So that two options cant be chosen twice?

like:

[code]<select name="select">
<object value="hello">Hello</object>
<object value="goodbye">Goodbye</object>
</select>[/code]

Thanks,

Any reply is appreciated.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.