PDA

View Full Version : Question about form to email


Skydog
07-28-2015, 03:29 AM
This is a really not important question, but I still have the question. I run a college football pool for fun with a few friends. I created it in Dreamweaver. I have several games listed each week, players select the radio button beside the teams that they think will win, choose tiebreaker points, then click submit. From there I have a formtoemail.php script that sends me an email with their picks for each game. My issue is that the email I receive with the winner of each game looks like the following:

Game 1: Cincinnati

Game 2: Georgia

I would prefer it look like this:
Cincinnati
Georgia

I am cutting and pasting the picks into an excel spreadsheet (because I don't know any better), it would be easier to deal with it if it could look like that.

Here is the code I copied from Dreamweaver that shows you a typical week's games. Thanks for any assistance.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Football Pool</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
} }
//-->
</script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
style1 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>

<body bgcolor="#000033">
<form action="FormToEmail.php" method="post" name="form1">
<br>
<table width="94%" border="1" align="center" cellpadding="4" cellspacing="0">
<tr bgcolor="#FFCC66">
<td colspan="2"> <div align="center"></div></td>
</tr>
<tr bgcolor="#FFCC66">
<td width="58%" height="47"><strong><font size="4" face="Arial, Helvetica, sans-serif">Name:
<input name="Name" type="text" id="Name" size="40">
&nbsp;&nbsp;&nbsp;&nbsp;</font></strong><font size="4" face="Arial, Helvetica, sans-serif">Week
8 - Due 10/16 at 7:30pm</font></td>
<td width="42%" colspan="-4"><div align="left"><font face="Arial, Helvetica, sans-serif"><strong><font size="4" face="Arial, Helvetica, sans-serif">Email:</font></strong>
<input name="Email" type="text" id="Email" size="50">
</font></div></td>
</tr>
</table>
<table width="94%" border="1" align="center" cellpadding="2" cellspacing="0">

<tr bgcolor="#FFCC66">
<td width="18%" height="38"> <div align="center"><font size="4" face="Arial, Helvetica, sans-serif">
Visitor</font></div></td>
<td width="23%"><div align="center"><font size="4" face="Arial, Helvetica, sans-serif">Home team</font></div></td>
<td width="7%"> <div align="center"><font size="4" face="Arial, Helvetica, sans-serif">Day</font></div></td>
<td width="5%"> <div align="center"><font size="4" face="Arial, Helvetica, sans-serif">Time</font></div></td>
<td width="6%"> <div align="center"><font size="4" face="Arial, Helvetica, sans-serif">TV</font></div></td>
<td width="14%"> <div align="center"><font size="4" face="Arial, Helvetica, sans-serif">Conference
Count</font></div></td>
<td width="27%"> <div align="center"><font size="4" face="Arial, Helvetica, sans-serif">Notes</font></div></td>
</tr>
<tr bgcolor="#FFCC66">
<td height="23" colspan="2"><div align="center"><strong><font size="4" face="Arial, Helvetica, sans-serif">ACC/SEC
Games</font></strong></div></td>
<td width="7%"><div align="center"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td width="5%"><div align="center"></div></td>
<td width="6%"><div align="center"></div></td>
<td width="14%">&nbsp;</td>
<td><font face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
</tr>
<tr bgcolor="#FFCC66">
<td height="23"> <div align="left" class="style1">
<input type="radio" name="Game 1" value="Virgina Tech">
Virginia Tech</div></td>
<td height="23"><div align="left" class="style1">&nbsp;&nbsp;
<input type="radio" name="Game 1" value="Pittsburgh">
Pittsburgh</div></td>
<td width="7%"><span class="style1">Thursday</span></td>
<td width="5%"><span class="style1">7:30</span></td>
<td width="6%"><span class="style1">ESPN</span></td>
<td width="14%">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFCC66">
<td height="23"><div align="left" class="style1">
<input type="radio" name="Game 2" value="Virginia">
Virginia</div></td>
<td height="23"><div align="left" class="style1">&nbsp;&nbsp;
<input type="radio" name="Game 2" value="Duke">
Duke
</div></td>
<td><span class="style1">Saturday</span></td>
<td><span class="style1">12:30</span></td>
<td><span class="style1">ACC</span></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFCC66">
<td height="23"> <div align="left" class="style1">
<input type="radio" name="Game 3" value="Clemson">
Clemson</div></td>
<td height="23"><div align="left" class="style1">&nbsp;&nbsp;
<input type="radio" name="Game 3" value="Boston College">
Boston College</div></td>
<td width="7%"><span class="style1">Saturday</span></td>
<td width="5%"><span class="style1">3:30</span></td>
<td width="6%"><span class="style1">ESPNU</span></td>
<td width="14%">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFCC66">
<td height="23"> <div align="left" class="style1">
<input type="radio" name="Game 4" value="Texas A&amp;M">
Texas A&amp;M</div></td>
<td height="23"><div align="left" class="style1">&nbsp;&nbsp;
<input type="radio" name="Game 4" value="Alabama">
Alabama</div></td>
<td width="7%"><span class="style1">Saturday</span></td>
<td width="5%"><span class="style1">3:30</span></td>
<td width="6%"><span class="style1">CBS</span></td>
<td width="14%">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFCC66">
<td height="23"> <div align="left" class="style1">
<input type="radio" name="Game 5" value="Georgia">
Georgia</div></td>
<td height="23"><div align="left" class="style1">&nbsp;&nbsp;
<input type="radio" name="Game 5" value="Arkansas">
Arkansas</div></td>
<td><span class="style1">Saturday</span></td>
<td width="5%"><span class="style1">3:00</span></td>
<td width="6%"><span class="style1">SEC</span></td>
<td width="14%">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFCC66">
<td height="47" colspan="2" align="center" valign="middle"><font face="Arial, Helvetica, sans-serif">&nbsp;</font>
<font face="Arial, Helvetica, sans-serif"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>&nbsp;* Rankings by AP<strong> *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tota l
Points</strong></font> <div align="right"><font face="Arial, Helvetica, sans-serif"></font></div></td>
<td width="7%"> <div align="center">
<input name="Total Points" type="text" id="Total Points" size="10">
</div></td>
<td width="5%"><font face="Arial, Helvetica, sans-serif">
<input name="Submit2" type="submit" onClick="MM_validateForm('Name','','R','Email','','R','Team 1 (Winner)','','Rinner','Team 2 (Loser)','','Roser','Points','','R','Total Points','','R');return document.MM_returnValue" value="Submit">
</font></td>
<td colspan="3" valign="middle"><font face="Arial, Helvetica, sans-serif">&nbsp;</font><font face="Arial, Helvetica, sans-serif">&nbsp;<strong><font size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></strong></font>
&nbsp;<strong><font face="Arial, Helvetica, sans-serif"><strong>Comment<font face="Arial, Helvetica, sans-serif">:</font></strong></font>
&nbsp;
<input name="Comment" type="text" size="60" id="Comment">
</strong></td>
</tr>
</table>
</form>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {isRequired:false});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {isRequired:false});
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {isRequired:false});
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "none", {isRequired:false});
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {isRequired:false});
var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "none", {isRequired:false});
//-->
</script>
</body>
</html>

edbr
07-28-2015, 04:05 AM
i would think this is caused by your mail handler. it appears to be echoing the $key as well as the $value
<input type="radio" name="Game 2" value="Duke">