It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

HTML Email Form

HTML Email Form

Postby thedrumguy on Tue Mar 23, 2010 2:51 pm

Hello everyone. I've got a question about this form.
The form is all set up in spry so that I can make sure people are entering information correctly. However, I'm having trouble sending it in an e-mail.
Here's the code of the form:
Code: Select all
<center><form method="post" action="sendmail.php" name="application">
<span id="sprytextfield1"><label>Your E-mail address
  <input type="text" name="email" id="email" accesskey="@" />
</label>
<span class="textfieldRequiredMsg">Please enter a valid E-mail.</span></span><br />
<span id="sprytextfield2"><label>Your user name (on our website)
  <input type="text" name="AKAusername" id="AKAusername" />
</label>
<span class="textfieldRequiredMsg">You must enter your user name.</span></span><br />
<span id="sprytextfield3">
<label>Your Combat Arms profile page <a href="http://akassault.ulmb.com/e107/e107_plugins/forum/forum_viewtopic.php?3" target="_blank">What's this?</a>
  <input type="text" name="caprofilepage" id="caprofilepage" accesskey="net" />
</label>
<span class="textfieldRequiredMsg">Please enter a valid url.</span></span><br />
<span id="sprytextfield4">
<label>Your rank
  <input type="text" name="rank" id="rank" />
</label>
<span class="textfieldRequiredMsg">Please enter a valid rank.</span></span><br />
<span id="sprytextfield5">
<label>Your kill-death ratio
  <input type="text" name="kdr" id="kdr" accesskey="." />
</label>
<span class="textfieldRequiredMsg">Please enter a valid number.</span></span><br />
<span id="sprytextfield6">
<label>Number of games played
  <input type="text" name="#ofgamesplayed" id="#ofgamesplayed" />
</label>
<span class="textfieldRequiredMsg">Please enter a number.</span></span><br />
<b>Pick one:</b><br />
  <span id="spryradio1">
  <label>
    <input type="radio" name="sniper/rusher" value="sniper" id="sniper/rusher_0" />
    Sniper</label>
  <br />
  <label>
    <input type="radio" name="sniper/rusher" value="rusher" id="sniper/rusher_1" />
    Rusher</label>
  <br />
  <span class="radioRequiredMsg">Please make a selection.</span></span><br />
<b>How would you like to be contacted?</b><br />
  <span id="spryradio2">
  <label>
    <input type="radio" name="howtocontact" value="email" id="howtocontact_0" />
    E-mail</label>
  <br />
  <label>
    <input type="radio" name="howtocontact" value="pm" id="howtocontact_1" />
    Private Message</label>
  <br />
  <span class="radioRequiredMsg">Please make a selection.</span></span><br />
  <input name="submit" type="submit" value="Submit" /><input name="reset" type="reset" value="Clear Form" />
</form></center>

And this is for all the spry stuff:
Code: Select all
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
var spryradio1 = new Spry.Widget.ValidationRadio("spryradio1");
var spryradio2 = new Spry.Widget.ValidationRadio("spryradio2");
//-->
</script>

The problem I have is getting the e-mail to include all the information from the form. This is my php file for sending it:
Code: Select all
<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;

  mail( "(my email is here", "my subject is here",
    $application, "From: $email" );
  header( "Location: http://www.akassault.ulmb.com/thankyou.php" );
?>

But when the e-mail comes in, the subject and sender are there, but there is nothing in the message. I'd like it to include all of the information that the person entered.
If anyone can help me with this, I thank you in advance.
-thedrumguy
thedrumguy
 
Posts: 5
Joined: Tue Mar 23, 2010 2:44 pm

Re: HTML Email Form

Postby webmaster on Thu Mar 25, 2010 11:45 pm

What do you want the message to contain?

This PHP-code should work!
Code: Select all
<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;

$application = "Message that should be mailed...";

  mail( "(my email is here", "my subject is here",
    $application, "From: $email" );
  header( "Location: http://www.akassault.ulmb.com/thankyou.php" );
?>
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Re: HTML Email Form

Postby thedrumguy on Fri Apr 23, 2010 9:55 pm

Thanks for your help, I got the form working! :)
thedrumguy
 
Posts: 5
Joined: Tue Mar 23, 2010 2:44 pm


Who is online

Users browsing this forum: No registered users and 7 guests