logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 11-19-2012, 12:36 PM   #1
Antoakatoe
 
Join Date: Nov 2012
Posts: 3
Default Php form submit radio group

Hi guys,

I'm new to this and also inexperienced so please excuse my mistakes.

I have set up a website and from the HTML end of things all is well. I have however a feedback page where I have a form with a few data variables. I think I have the php set up ok except for the radio group. I have no clue how to set up the code for the radio group please see images below.

HTML for radio group...


Here are my current data variables and I want to add below the radio group code...


If some one could please help me with this I would be extremely grateful.. This has been driving me nuts.

Anthony
Antoakatoe is offline   Reply With Quote
Old 11-20-2012, 08:43 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

$radio =$_POST['foodquality'];

and in your email add echo $radio;
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 11-20-2012, 09:40 PM   #3
Antoakatoe
 
Join Date: Nov 2012
Posts: 3
Default

Hi edbr,

Thank you for taking the time to help me... I have added in your code but I am unsure of the echo bit. Below is the code I currently have.. I got this from various YouTube tutorials etc. so I really am a small fish in a big pond!.

I am thinking of entering in a second radio group i am assuming i do the following...

$radio =$_POST['name of new group'];

put this below..
New Label: $name of new group <br>

am i on the right track or completely lost? I really appreciate your help so far.

Anthony

<?php

/*Subject and Email Variables*/

$emailSubject = 'Feedback';
$webMaster = 'my email address';

/*Data Variables*/

$name = $_POST['name'];
$email = $_POST['email'];
$contacttel = $_POST['contacttel'];
$dateoforder = $_POST['dateoforder'];
$time = $_POST['time'];
$avgtime = $_POST['avgtime'];
$shopselect = $_POST['shopselect'];
$radio =$_POST['foodquality']; <---------- YOUR Code

$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Contact Tel: $contacttel <br>
Date Of Order: $dateoforder <br>
Time: $time <br>
Average Wait Time: $avgtime <br>
Shop: $shopselect <br>
Food Quality: $foodquality <br> <--------------- Is this Correct?
EOD;

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster,$emailSubject,$body,$headers);

/*Results rendered as HTML*/

$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3";URL=http://my url">
<style type="text/css">
<!--
body{
background-color:#111;
font-family: sans-serif, Veranda, Aerial, Helvetica;
font-size: 20px
font-style: normal;
line-height: normal;
color: #696969
text-decoration: none;
padding-top: 300px;
margin-left: 400px;
width: 450px;
}
-->
</style>
</head>
<div align="center">Your message has been sent, thank you.</div>
</body>
</html>
EOD;
echo "$theResults";
?>
Antoakatoe is offline   Reply With Quote
Old 11-21-2012, 02:32 AM   #4
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

this is the section that will be sent to you and should contain the variables you have named
Code:
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Contact Tel: $contacttel <br>
Date Of Order: $dateoforder <br>
Time: $time <br>
Average Wait Time: $avgtime <br>
Shop: $shopselect <br>
Food Quality: $foodquality <br> <--------------- Is this Correct?
EOD;
so last lline

Food Quality: $foodquality <br>

should be

Food Quality: $radio <br>

or change variable to $foodquality =$_POST['foodquality'];
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 11-21-2012, 07:44 PM   #5
Antoakatoe
 
Join Date: Nov 2012
Posts: 3
Default

I will put the variable as this:

$foodquality =$_POST['foodquality'];

then the leave the data to be sent as this

Food Quality: $foodquality <br>

Hopefully I get it working. I'm due to upload to host on Monday. I will let you know if it all runs smoothly.

Really appreciate your help.

Anthony
Antoakatoe is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:56 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com