Jump to content

PHP radio buttons..


Ju5

Recommended Posts

I have made a form which includes text fields and radio buttons.

The user completes the fields and makes their selections. Once the form is submit, they are then directed to a php file which displays their entries and selections.

 

Atm I can't quite work out how to post their radio button selections.

 

Here is the form:

<legend>Car type</legend>

<input name="cartype" type="radio" value="1" id="carone" />

<label for="carone">Compact</label><br />

<input name="cartype" type="radio" value="2" id="cartwo" />

<label for="cartwo">Saloon</label><br />

<input name="cartype" type="radio" value="3" id="carthree" />

<label for="carthree">SUV</label>

 

and here is my current code for the text fields:

<?php

$firstname = $_POST['firstname'];

$lastname = $_POST['lastname'];

$emailaddress = $_POST['emailaddress'];

$phone = $_POST['phone'];

 

 

echo "Dear ". $firstname . " " . $lastname . ",<br />";

echo "Thank you for your order. <br />";

echo "Your contact details are:- <br />";

echo "phone: " . $phone . "<br />";

echo "email: " . $emailaddress . "<br />";

 

?>

</body></html>

 

If anyone could give a hand I'd be very grateful!

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.