Código HTML:
<? include("menu.php"); ?> FORM <form method="post" action="ontheedge_signup_confirm.php"><table width="650" border=0 cellspacing=3 cellpadding=0> Applicant Information: Name: <INPUT NAME="app_name" TYPE="TEXT" size=60> Street Address: <INPUT NAME="app_address" TYPE="TEXT" size=60> City, State, ZIP: <INPUT NAME="app_citystatezip" TYPE="TEXT" size=60> Day Phone Number: <INPUT NAME="app_dayphone" TYPE="TEXT" size=60> Night Phone Number: <INPUT NAME="app_nightphone" TYPE="TEXT" size=60> Fax Number: <INPUT NAME="app_faxnumber" TYPE="TEXT" size=60> Email Address: <INPUT NAME="app_email" TYPE="TEXT" size=60> Car Information:Make: <INPUT NAME="app_make" TYPE="TEXT" size=60> </div></td> </tr> <tr><td align=right><span class="style31">Model:</span></td> <td><div align="left"> <INPUT NAME="app_model" TYPE="TEXT" size=60> </div></td> </tr> <tr><td align=right><span class="style31">Year:</span></td> <td><div align="left"> <INPUT NAME="app_year" TYPE="TEXT" size=60> </div></td> </tr> <tr><td align=right><span class="style31">Color:</span></td> <td><div align="left"> <INPUT NAME="app_color" TYPE="TEXT" size=60> </div></td> </tr> <tr><td align=right><span class="style31">Stock or Modified:</span></td> <td><div align="left"> <INPUT NAME="app_stockmod" TYPE="TEXT" size=60> </div></td> </tr> <tr><td align=right><span class="style31">Car Number Desired:</span></td> <td><div align="left"> <INPUT NAME="app_number1" TYPE="TEXT" size=60> </div></td> </tr> <tr><td align=right><span class="style31">Alternate:</span></td> <td><div align="left"> <INPUT NAME="app_number2" TYPE="TEXT" size=60> </div></td> </tr> <tr><td colspan=2><p align="left"> </p> <p align="center" class="style30"><B><I>Driving Group:</I></B></p></td> </tr> <tr><td align=right><div align="left"> <INPUT TYPE="radio" NAME="app_group" VALUE="Beginner" checked="checked"> Beginner :</div></td><td align=left><div align="left"></div></td></tr> <tr><td colspan=2><p align="left" class="copyright style29"></p></td> </tr> <tr><td align=right><div align="left"> <INPUT TYPE="radio" NAME="app_group" VALUE="Intermediate"> Intermediate :</div></td><td align=left><div align="left"></div></td></tr> <tr><td colspan=2><p align="left" class="copyright style29"></p></td> </tr> <tr><td align=right><div align="left"> <INPUT TYPE="radio" NAME="app_group" VALUE="Advance"> Advance :</div></td><td align=left><div align="left"></div></td></tr> <tr><td colspan=2><p align="left" class="copyright style29"></p></td> </tr> <tr><td colspan=2><p align="left" class="style41"> </p> <p align="left" class="style41"><span class="style42">R> </p></td> </tr> <tr><td colspan=2><p align="left" class="style31"> </p> <p align="center" class="style30"><strong>Instruction:</strong></p> <p align="left" class="style31"> <INPUT TYPE="radio" NAME="app_instructor" VALUE="0" checked="checked"> Not Needed </p> <p align="left" class="style31"> <INPUT TYPE="radio" NAME="app_instructor" VALUE="1"> One Session $30 </p> <p align="left" class="style31"> <INPUT TYPE="radio" NAME="app_instructor" VALUE="2"> Two Sessions $60 </p> <p align="left" class="style31"> <INPUT NAME="app_instructor" TYPE="radio" VALUE="3"> Three Sessions $90 </p> <p align="left" class="style31"> <INPUT TYPE="radio" NAME="app_instructor" VALUE="4"> Four Sessions $120 </p> <p align="left" class="style31"> <INPUT TYPE="radio" NAME="app_instructor" VALUE="all"> All Day $150 </p> <p align="left" class="style31"><strong> </strong></p> <p align="left" class="style31"><strong> <INPUT NAME="app_day" TYPE="radio" VALUE="10/24/2009"> Sign up for Saturday, November 21st 2009 </strong></p> <p align="left" class="style31"> </p> <p align="left" class="style31"><strong>TOTAL $ <INPUT NAME="app_total" TYPE="TEXT" size=60> </strong></p> <p align="center" class="style31"><span class="style30"><B>Payment:</B></span></p></td></tr> <tr><td colspan=2><div align="left" class="style31"><INPUT TYPE="radio" NAME="app_payment" VALUE="Credit" checked="checked"> Credit Card (add 3.5 %)</div></td></tr> <tr><td colspan=2><div align="left" class="style31"> <p> <INPUT TYPE="radio" NAME="app_payment" VALUE="Check"> Check</p> <tr><td colspan=2><div align="left" class="style31"><p align="center" class="style31"><span class="style30"><B>Credit Card Information:</B></span></p></div></td></tr> <tr><td colspan=2><div align="left" class="style31"><input type="radio" name="app_cctype" value="Visa">Visa</div></td></tr> <tr><td colspan=2><div align="left" class="style31"><INPUT TYPE="radio" NAME="app_cctype" VALUE="Mastercard"> Master Card</div> </tr> <tr><td align=right><p align="right" class="style31">Credit Card Number:</p> </td><td> <div align="left" class="style31"> <div align="left"> <input type="TEXT" name="app_ccnumber" size=60> </div> </div></td></tr> <tr><td align=right><p align="right" class="style31">Expiration Date:</p> </td><td> <div align="left" class="style31"> <div align="left"> <INPUT TYPE="TEXT" NAME="app_ccexp" size=60> </div> </div></td></tr> <tr> <td align=right><div align="right"><span class="style31">CCV</span></div></td> <td><div align="left"> <INPUT NAME="app_ccccv" TYPE="TEXT" id="app_ccccv" size=60> </div></td> </tr> <tr> <td colspan=2><p align="left" class="style31"> </p> <p align="left" class="style31"><span class="style37">Please let us know how you were referred to us:</span> <INPUT NAME="app_let" TYPE="TEXT" id="app_let" size=35> </p> </table> <p> <input name="submit" type="submit" class="style6" value="Submit"> </p> </form></td> </tr> </table> </td> </tr> <tr>
Y este es el script que hace el trabajo de enviar los datos por email:
Código PHP:
<? //initilize PHP
if($submit) //If submit is hit
{
$email_content="Applicant Information:\nName: " . $app_name . "\nStreet Addess: " . $app_address . "\nCity, State, ZIP: " . $app_citystatezip . "\nDay Phone Number: " . $app_dayphone . "\nNight Phone Number: " . $app_nightphone . "\nFax Number: " . $app_faxnumber . "\nEmail Addess: " . $app_email . "\nReferred by: " . $app_let . "\n\nCar Information:\nMake: " . $app_make . "\nModel: " . $app_model . "\nYear: " . $app_year . "\nColor: " . $app_color . "\nStock or Modified: " . $app_stockmod . "\nCar Number Desired: " . $app_number1 . "\nAlternate: " . $app_number2 . "\n\nDriving Group: " . $app_group . "\nTiming: " . $app_timer . "\nInstructor: " . $app_instructor . "\nDay: " . $app_day . "\nTotal: " . $app_total . "\n\nPayment: " . $app_payment . "\n\nCC Information:\nCredit Card Type: " . $app_cctype . "\nCredit Card Number: " . $app_ccnumber . "\nExpiration Date: " . $app_ccexp . "\nCCV: " . $app_ccccv;
$email_content2="Applicant Information:\nName: " . $app_name . "\nStreet Addess: " . $app_address . "\nCity, State, ZIP: " . $app_citystatezip . "\nDay Phone Number: " . $app_dayphone . "\nNight Phone Number: " . $app_nightphone . "\nFax Number: " . $app_faxnumber . "\nEmail Addess: " . $app_email . "\nReferred by: " . $app_let . "\n\nCar Information:\nMake: " . $app_make . "\nModel: " . $app_model . "\nYear: " . $app_year . "\nColor: " . $app_color . "\nStock or Modified: " . $app_stockmod . "\nCar Number Desired: " . $app_number1 . "\nAlternate: " . $app_number2 . "\n\nDriving Group: " . $app_group . "\nTiming: " . $app_timer . "\nInstructor: " . $app_instructor . "\nDay: " . $app_day . "\nTotal: " . $app_total;
mail("[email protected]", "On The Edge Track Day Registration Submission", "$email_content");
mail("$app_email", "On The Edge Track Day Registration Submission Confirmation", "$email_content2");
echo "Thank you for your submission. You will be contacted shortly by Carlos via e-mail or phone to confirm your registration.
} else {
echo "There has been an error, please go back to the form, and resubmit it.";
}
?>
Código PHP:
echo "There has been an error, please go back to the form, and resubmit it.";