email handler

Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.

Popular code excerpts may be moved to "Code Snippets" by the moderators.

Moderator: General Moderators

Post Reply
Trizen
Forum Newbie
Posts: 2
Joined: Fri Jul 11, 2008 5:29 pm

email handler

Post by Trizen »

ok ive done this before but i dont know why its not working now, i think maybe im a little to confident that it should work and im missing a small error that i should normally see or maybe im just doing something completly wrong. but please take a look at my code and see if u can help me out, thank in advance.

Code: Select all

<?php
$Name = $_POST['Name'];
$Contact_email = $_POST['Contact_email'];
$Age = $_POST['Age'];
$Time_played = $_POST['Time_played'];
$Why_join = $_POST['Why_join'];
$Other_games = $_POST['Other_Games'];
 
 
$formsent = mail('myemail@verizon.net',
'RGC Website Application',
"Request From: 
Name: $Name\r\n
Contact_email: $Contact_email\r\n
Age: $Age\r\n
Time_played: $Time_played\r\n
Why_join: $Why_join\r\n
Other_Games: $Other_Games",
 
"From: $Contact_email\r\n Bounce-to: myemail@verizon.net");
   if ($formsent) {
  echo "<P>Hi, $Name, we have received your request, we will respond to you as soon as possible.
Thank You,
Renegade Gameing Community";
} else {
   echo "I'm sorry $Name, but there seems to be a problem, please try to resubmitt the form.";
}
?>
this is my php form handler

Code: Select all

<input type="hidden" name="validate" value="1">
            <form action="join_us.php" method="post" name="Join_us" onSubmit="return validate(this)">
              <p>
                <label>Name
                <input type="text" name="Name" id="Name" />
                </label>
              </p>
              <p>&nbsp;</p>
              <p>
                <label>Email
                <input type="text" name="Contact_email" id="Contact_email" />
                </label>
</p>
              <p>&nbsp;</p>
              <p>Age
                <input type="text" name="Age" id="Age" />
              </p>
              <p>
                <label>What other games do you play?
                <textarea name="Other Games" id="Other_Games" cols="45" rows="5"></textarea>
                </label>
              </p>
               <p>&nbsp;</p>
               <p>&nbsp;</p>
               <p>&nbsp;</p>
               <p>&nbsp;</p>
               <p>
                 <label>Why do you want to join RGC?
                 <textarea name="Why_join" id="Why_join" cols="45" rows="5"></textarea>
                 </label>
                </p>
              <p>&nbsp;</p>
              <p>&nbsp;</p>
              <p>&nbsp;</p>
              <p>
                <label></label>
              </p>
              <p>
                <label>How many days a week do you play CSS?
                <input type="text" name="Time_played" id="Time_played" />
                </label>
              </p>
              <p>&nbsp;</p>
              <p>&nbsp;</p>
              <p>&nbsp;</p>
              <p>&nbsp;</p>
              <p>&nbsp;</p>
              <p>&nbsp;</p>
              <p>&nbsp;</p>
              <p>&nbsp; </p>
              <p>
                <label> 
                 <input type="submit" value="Submit Form" /></a>
                </label>
              </p>
            </form>
this is the html code for the form that im sending



but im getting this message
I'm sorry andieghthg, but there seems to be a problem, please try to resubmitt the form.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: email handler

Post by Benjamin »

More than likely incorrect usage of the mail function. Please reference http://us2.php.net/manual/en/function.mail.php for appropriate usage.
Trizen
Forum Newbie
Posts: 2
Joined: Fri Jul 11, 2008 5:29 pm

Re: email handler

Post by Trizen »

i got it working, it was the server, the sendmail path was incorrect, thanks for looking though
Post Reply