www.webdeveloper.com
Results 1 to 11 of 11

Thread: Front Page Form to email

  1. #1
    Join Date
    May 2007
    Posts
    7

    Front Page Form to email

    Hello all,

    I am very new at this and am trying to convert this form into an email message that is automatically sent to an email address. I have tried to use PHP to do this and it has not worked. If someone could help me along I would be in your debt. Here is the form that I created in Front Page. Thanks in advance.

    <html>

    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>GNFL Submission Form</title>
    </head>

    <body>

    <table border="0" width="100%" id="table3" height="218">
    <tr>
    <td>
    <div align="center">
    <center>
    <table id="table4" style="border-collapse: collapse" borderColor="#111111" cellSpacing="0" cellPadding="0" width="690" border="0">
    <tr>
    <td align="middle" width="204" rowSpan="7">
    <font face="Verdana">
    <img height="162" src="gnfl1.gif" width="125" align="left" border="0">&nbsp;
    &nbsp; </font></td>
    <td width="554">&nbsp;</td>
    </tr>
    <tr>
    <td width="554">&nbsp;</td>
    </tr>
    <tr>
    <td align="middle" width="554"><font face="Verdana"><b>
    <font size="5">G</font><font size="4">RIDIRON&nbsp; </font>
    <font size="5">N</font><font size="4">ATION</font>
    <font size="5">F</font><font size="4">OOTBALL&nbsp; </font>
    <font size="5">L</font><font size="4">EAGUE<img height="58" src="gnfltrophy.gif" width="34" border="0"></font></b></font><p>
    <b><font face="Verdana" size="5">S</font></b><font face="Verdana"><b><font size="4">UBMISSION</font>
    <font size="5">F</font><font size="4">ORM</font></b></font></td>
    </tr>
    </table>
    </center></div>
    </td>
    </tr>
    </table>
    <table border="0" width="100%" id="table5" height="50">
    <tr>
    <td>
    <p align="center">** ALL CHANGES DEADLINE IS 7:00 P.M. WEDNESDAY**<br>
    #1 - Defensive Playbooks and Profiles are combined.&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;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <br>
    #2 - Specific stipulations &amp; PLAYER CHANGES for 2nd half changes Should be
    listed below.<br>
    #3 - ANY player movement should be detailed below.(Trades, FA requests,
    roster moves, etc.)</td>
    </tr>
    </table>
    <form method="POST" action="gnfl.php">

    <p>&nbsp; Team&nbsp; <select size="1" name="Team">
    <option> </option>
    <option>Prichard Wolfpack</option>
    <option>Myers Stampede</option>
    <option>Walker Outlaws</option>
    <option>Thornburg Assassins</option>
    <option>Ballew Bangers</option>
    <option>Culbertson Cowboys</option>
    <option>Davis Ninjas</option>
    <option>Von Achen Spinal Crackers</option>
    <option>Young Sherlocks</option>
    <option>Wegner Marauders</option>
    <option>Stephenson Sabercats</option>
    <option>Martz Hurling Charros</option>
    <option>LaPorta T-Bones</option>
    <option>Gibson Bulldawgs</option>
    <option>Neddo Doom</option>
    <option>Dukes Dominators</option>
    <option>Forseth Rogues</option>
    <option>Hansen Ridgebacks</option>
    </select>

    &nbsp;&nbsp; Week&nbsp; <select size="1" name="Week">
    <option> </option>
    <option>EVERY WEEK</option>
    <option>Pre-Season</option>
    <option>Week 1</option>
    <option>Week 2</option>
    <option>Week 3</option>
    <option>Week 4</option>
    <option>Week 5</option>
    <option>Week 6</option>
    <option>Week 7</option>
    <option>Week 8</option>
    <option>Week 9</option>
    <option>Week 10</option>
    <option>Week 11</option>
    <option>Week 12</option>
    <option>Week 13</option>
    <option>Week 14</option>
    <option>Play Offs</option>
    </select>

    &nbsp;&nbsp;&nbsp; Your E-Mail Address&nbsp;
    <input type="text" name="Emailfrom" size="35"></p>

    <p>1st Half Offense Playbook&nbsp;
    <select size="1" name="OffPB1">
    <option> </option>
    <option>GNFL</option>
    <option>WFL</option>
    <option>West Coast</option>
    <option>Power</option>
    <option>Red Gun</option>
    <option>Spread</option>
    <option>Power Plus</option>
    <option>Run and Shoot</option>
    <option>Red Wolf</option>
    </select>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1st Half Offensive
    Profile&nbsp;&nbsp;
    <select size="1" name="OffPR1">
    <option> </option>
    <option>Classic Run</option>
    <option>Classic Balanced</option>
    <option>Classic Pass</option>
    <option>Classic Run and Shoot</option>
    <option>Classic Power</option>
    <option>VPNFL Run</option>
    <option>VPNFL Balanced</option>
    <option>VPNFL Pass</option>
    <option>VPNFL Balanced / Chuck</option>
    <option>VPNFL Run / Chuck</option>
    <option>VPNFL Run / Heavy</option>
    <option>VPNFL Run / Balanced</option>
    <option>VPNFL West Coast</option>
    <option>VPNFL Pass / Heavy</option>
    <option>VPNFL Balanced / Dink</option>
    <option>VPNFL Run / Dink</option>
    <option>VPNFL Script</option>
    <option>VPNFL Gambler</option>
    </select>

    &nbsp;&nbsp;&nbsp; 1st Half Defense&nbsp;&nbsp;
    <select size="1" name="DEF1">
    <option> </option>
    <option>4 - 3 Run</option>
    <option>4 - 3 Pass</option>
    <option>4 - 3 Man to Man Run</option>
    <option>4 - 3 Man to Man Pass</option>
    <option>3 - 4 / 4 - 3 Hybrid Run</option>
    <option>3 - 4 / 4 - 3 Hybrid Pass</option>
    <option>Buddy 4 - 6 Run</option>
    <option>Buddy 4 - 6 Pass</option>
    <option>Longhorn 5 - 2 Run</option>
    <option>Longhorn 5 - 2 Pass</option>
    </select></p>

    <p>2nd Half Offense Playbook
    <select size="1" name="OffPB2">
    <option> </option>
    <option>GNFL</option>
    <option>WFL</option>
    <option>West Coast</option>
    <option>Power</option>
    <option>Red Gun</option>
    <option>Spread</option>
    <option>Power Plus</option>
    <option>Run and Shoot</option>
    <option>Red Wolf</option>
    </select>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2nd Half Offensive
    Profile&nbsp;
    <select size="1" name="OffPR2">
    <option> </option>
    <option>Classic Run</option>
    <option>Classic Balanced</option>
    <option>Classic Pass</option>
    <option>Classic Run and Shoot</option>
    <option>Classic Power</option>
    <option>VPNFL Run</option>
    <option>VPNFL Balanced</option>
    <option>VPNFL Pass</option>
    <option>VPNFL Balanced / Chuck</option>
    <option>VPNFL Run / Chuck</option>
    <option>VPNFL Run / Heavy</option>
    <option>VPNFL Run / Balanced</option>
    <option>VPNFL West Coast</option>
    <option>VPNFL Pass / Heavy</option>
    <option>VPNFL Balanced / Dink</option>
    <option>VPNFL Run / Dink</option>
    <option>VPNFL Script</option>
    <option>VPNFL Gambler</option>
    </select>

    &nbsp;&nbsp;&nbsp; 2nd Half Defense&nbsp;
    <select size="1" name="DEF2">
    <option> </option>
    <option>4 - 3 Run</option>
    <option>4 - 3 Pass</option>
    <option>4 - 3 Man to Man Run</option>
    <option>4 - 3 Man to Man Pass</option>
    <option>3 - 4 / 4 - 3 Hybrid Run</option>
    <option>3 - 4 / 4 - 3 Hybrid Pass</option>
    <option>Buddy 4 - 6 Run</option>
    <option>Buddy 4 - 6 Pass</option>
    <option>Longhorn 5 - 2 Run</option>
    <option>Longhorn 5 - 2 Pass</option>
    </select></p>

    <p>Do you want ONE or TWO Kick Returners when receiving a kick off?
    <INPUT type=radio name="radiokr">ONE
    <INPUT type=radio name="radiokr" CHECKED>TWO (Default)

    <p>Do you want to use the &quot;White Shoes&quot; Punt coverage formation (chances of a blocked punt are increased, but hang time is longer)?
    <INPUT type=radio name="radiows">YES
    <INPUT type=radio name="radiows" CHECKED>NO (Default)

    <p>2ND HALF STIPULATIONS - PLAYBOOK/PROFILE CHANGE&nbsp; (Please be
    specific to score, weather, etc.)</p>
    <p>&nbsp; Change #1&nbsp;&nbsp;IF <input size="47" name="change1a"> THEN SWITCH TO
    <input size="47" name="change1b"></p>
    <p>&nbsp; Change #2&nbsp;&nbsp;IF <input size="47" name="change2a"> THEN SWITCH TO
    <input size="47" name="change2b"></p>

    <p>&nbsp;&nbsp; 2ND HALF PERSONNEL STIPULATIONS AND CHANGES<br>
    &nbsp;&nbsp; You may select up to 2 Player personnel changes @ half time. You may
    select to substitute player's) regardless of<br>
    &nbsp;&nbsp; statistical happening OR use statistics at half as a stipulation. PLEASE,
    be specific as to the personnel change<br>
    &nbsp;&nbsp; &amp; the stipulation (if applies). Example: Rushing stats below 50 yards,
    change HB's as follows: HB1 Jackson, HB2 <br>
    &nbsp;&nbsp; Heyward, HB3 Word. OR, no stipulation. Example: At half bench HB Heyward,
    making HB1 Jackson, HB2 Heyward, HB3 Word.</p>
    <p>&nbsp;&nbsp; Player Change #1&nbsp;&nbsp; <input size="132" name="PlayerChange1"></p>
    <p>&nbsp;&nbsp; Player Change #2&nbsp;&nbsp; <input size="132" name="PlayerChange2"></p>

    <p>&nbsp;&nbsp; ROSTER CHANGES</p>
    <p>&nbsp;&nbsp; <textarea name="RosterChanges" rows="16" cols="77"></textarea></p>
    <p align="center"><input type="submit" name="submit" value="Submit"></p>
    </form>

    </body>

    </html>

  2. #2
    Join Date
    Nov 2006
    Location
    Springfield, MO
    Posts
    1,541
    What do the content of gnfl.php contain? That's where you would collect, validate and then send the results to a specified email address.
    Ryan Butler

    Ryan Butler.org

  3. #3
    Join Date
    May 2007
    Posts
    7

    Front Page to gnfl.php

    Here you go...Thanks for the help as well.

    <?php

    // get posted data into local variables
    $EmailTo = "GNFL Commissioner <gridiron_nation@yahoo.com>";
    $Team = Trim($_POST[Team]);
    $Week = Trim($_POST[Week]);
    $Emailfrom = Trim($_POST[Emailfrom]);
    $OffPB1 = Trim($_POST[OffPB1]);
    $OffPR1 = Trim($_POST[OffPR1]);
    $Def1 = Trim($_POST[Def1]);
    $OffPB2 = Trim($_POST[OffPB2]);
    $OffPR2 = Trim($_POST[OffPR2]);
    $Def2 = Trim($_POST[Def2]);
    $radiokr = Trim($_POST[radiokr]);
    $radiows = Trim($_POST[radiows]);
    $change1a = Trim($_POST[change1a]);
    $change1b = Trim($_POST[change1b]);
    $change2a = Trim($_POST[change2a]);
    $change2b = Trim($_POST[change2b]);
    $PlayerChange1 = Trim($_POST[PlayerChange1]);
    $PlayerChange2 = Trim($_POST[PlayerChange2]);
    $RosterChanges = Trim($_POST[RosterChanges]);

    // prepare email body text
    // tells you that the mail is sent from this form
    $Body .= "GNFL Submission Information\n";
    $Body .= "Team: $Team\n";
    $Body .= "Week: $Week\n";
    $Body .= "Email from: $Emailfrom\n";
    $Body .= "Offensive Playbook 1st Half: $OffPB1\n";
    $Body .= "Offensive Profile 1st Half: $OffPR1\n";
    $Body .= "Defensive Playbook & Profile 1st Half: $Def1\n";
    $Body .= "Offensive Playbook 2nd Half: $OffPB2\n";
    $Body .= "Offensive Profile 2nd Half: $OffPR2\n";
    $Body .= "Defensive Playbook & Profile 2nd Half: $Def2\n";
    $Body .= "ONE or TWO Kick Returners when receiving a kick off: $radiokr\n";
    $Body .= "Use the "White Shoes" Punt coverage formation: $radiows\n";
    $Body .= "2ND HALF STIPULATIONS Change #1**IF $change1a THEN SWITCH TO $change1b\n";
    $Body .= "2ND HALF STIPULATIONS Change #2**IF $change2a THEN SWITCH TO $change2b\n";
    $Body .= "2ND HALF PERSONNEL: Player Change #1:**$PlayerChange1\n";
    $Body .= "2ND HALF PERSONNEL: Player Change #2:**$PlayerChange2\n";
    $Body .= "Roster Changes: $RosterChanges\n";

    // send email
    $success = mail($Emailfrom, $Team, $Week);

    // redirect to success page
    if ($success){print "<meta http-equiv=\"refresh\" content=\"0;URL=GNFLreceived.htm\">";}
    else{print "<meta http-equiv=\"refresh\" content=\"0;URL=no.htm\">";}

    ?>

  4. #4
    Join Date
    Nov 2006
    Location
    Springfield, MO
    Posts
    1,541
    You didn't tell the mail function where to send the mail. Plus, you didn't supply correct parameters to the mail function. First is the email recipient, second is the subject line, third is the message body and last, which is optional, is headers, which is used to personalize and enable you to directly reply to the respondent. You'll need to set your headers variable to Emailfrom.

    PHP Code:
    <?php
    // send email 
    $success mail($EmailTo,, "Subject Line Here"$Body$headers);
    ?>
    Ryan Butler

    Ryan Butler.org

  5. #5
    Join Date
    May 2007
    Posts
    7
    Thanks, if there is anything else that doesn't look right then please let me know. I am very new to this and will test tonight when I can get to my ISP server. I may be back, soon.

  6. #6
    Join Date
    May 2007
    Posts
    7
    OK, I loaded everything up to the server and now I am getting:

    The page cannot be displayed. It is showing my domain name/gnfl.php when I hit the submit button. I made the changes you told me to do and I have gotten along further. Am I missing something else? Thanks in advance and I appreciate the help.

  7. #7
    Join Date
    May 2007
    Posts
    7
    Anybody got any help for me out there? Thanks in advance...

  8. #8
    Join Date
    Nov 2006
    Location
    Springfield, MO
    Posts
    1,541
    Have you uploaded GNFLreceived.htm & no.htm?
    Ryan Butler

    Ryan Butler.org

  9. #9
    Join Date
    Dec 2006
    Location
    Castle Pines North, CO
    Posts
    211
    Did you check with your web hosting provider to verify they support PHP?

  10. #10
    Join Date
    May 2007
    Posts
    7
    Yes, PHP is supported. Can you look at the script and amke sure there are no mistakes? Thanks in advance...

  11. #11
    Join Date
    Nov 2006
    Location
    Springfield, MO
    Posts
    1,541
    Is it giving you errors? If so, what are they? Furthermore, you'll have to provide us with the modified code.
    Ryan Butler

    Ryan Butler.org

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles