First off, apologies if this has been brought up before - i used the advanced search but couldnt find anything relevant.
i have a questionnaire-style list with radio buttons allowing the user to select the ranging values
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>User-Evaluation</title>
</head>
<body>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr> <form method="POST" action="thanks.php">
<P>
<td bgcolor="#CCCCCC"><h2><strong>Shakespeare User Evaluation </strong></h2>
<p> </p>
<h3>Number of Relevant Documents Found: </h3>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<input type="radio" name="Rel_Docs" />
All
<input type="radio" name="Rel_Docs" />
Mostly
<input type="radio" name="Rel_Docs"checked="yes" />
Some
<input type="radio" name="Rel_Docs" />
Little
<input type="radio" name="Rel_Docs" />
None</td>
</tr>
</table>
<h3>Speed of Returning Results:</h3>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="radio" name="Speed" />
Very
Fast
<input type="radio" name="Speed" />
Fast
<input type="radio" name="Speed" checked="yes"/>
Reasonable
<input type="radio" name="Speed" />
Slow
<input type="radio" name="Speed" />
Very Slow</td>
</tr>
</table>
<h3>Ease of Use:</h3>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<input type="radio" name="Diff" />
Very Easy
<input type="radio" name="Diff" />
Quite Easy
<input type="radio" name="Diff"checked="yes" />
Reasonable
<input type="radio" name="Diff" />
Tricky
<input type="radio" name="Diff" />
Very Hard </td>
</tr>
</table>
<h3>Ease to Learn: </h3>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="radio" name="Learn" />
Very Easy
<input type="radio" name="Learn" />
Quite Easy
<input type="radio" name="Learn"checked="yes" />
Reasonable
<input type="radio" name="Learn" />
Tricky
<input type="radio" name="Learn" />
Very Hard</td>
</tr>
</table>
<h3>Number of Queries Ran: </h3>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<input type="radio" name="Queries" />
Over 25
<input type="radio" name="Queries" />
18-24
<input type="radio" name="Queries"checked="yes" />
12-17
<input type="radio" name="Queries" />
6-11
<input type="radio" name="Queries" />
1-5</td>
</tr>
</table>
<h3>Comments/Suggestions on the System:</h3>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><textarea cols="80" rows="5"></textarea> </td>
</tr>
</table>
<p> </p>
<p>Name:<input type="text" name="UserName" size="24" maxlength="24" />
Age:<input type="text" name="Age" size="24" maxlength="2" />
<input type="submit" value="Submit" />
</P>
<p><input type="reset" value="Reset Fields" />
</form>
</p>
<p> </p>
<p> </p></td>
</tr>
</table>
</body>
</html>
and have some PHP which will email me what was filled in; however the email simply lets me see that the radio buttons are 'on' without returning which radio box was selected.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>thanks</title>
</head>
<body>
<script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "MYEMAILHERE";
$mailsubj = "Shakespeare Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>
<h1>Thanks, </h1>
<h1>Form Submitted Sucessfully! </h1>
</body>
</html>