Current location: Hot Scripts Forums » Programming Languages » PHP » mail Form help


mail Form help

Reply
  #1 (permalink)  
Old 02-18-05, 12:17 PM
eoj eoj is offline
New Member
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
mail Form help

I have this basic mail form which should display the input information and then send the message to me. Heres the problem, it displays the info but it dosen't send the message. It dosen't give me any errors either. If someone could have a look at this and see if they can see anything wrong I would appreciate it. Thanks.


Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<title>Form Test</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 
<body> 
<?php 
if ($_GET['post'] == 'yes') { 

   $to = "email@email.com";   
   $headers  = "MIME-Version: 1.0\r\n";   
   $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";   
   $headers .= "From: ".$_POST['email']."\r\n";   
   $mail = mail($to, $_POST['name'], $_POST['message'], $headers); 

   if ($mail) { 
       echo "Thank you, we will get back to you as soon as possible <br /> You sent the following information <br />" . $_POST['name'] . "<br /> " . $_POST['email'] . "<br />" . $_POST['name'] . "<br />";  
       echo "<a href=\"Form1.php?post=no\">Display the form</a>";  
 exit;
   } else { 
       echo 'email didnt send'; 
   } 
} 
?>  
<form action="Form1.php?post=yes" method="post"> 
<p>Your name: 
  <input type="text" name="name" /> 
</p> 
<p>Your email: 
  <input type="text" name="email" /> 
</p> 
<p>Message:    
  <textarea name="message" id="message"></textarea> 
<input type="submit" /> 
</form>
</body> 
</html>

Last edited by eoj; 02-18-05 at 01:14 PM.
Reply With Quote
  #2 (permalink)  
Old 02-18-05, 09:44 PM
wizkid's Avatar
wizkid wizkid is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
your script worked fine for me..
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
Perl CGI mail form script steezjjc Perl 1 11-02-04 09:59 AM
formmail problem gscraper Perl 12 08-27-04 03:06 AM
Proffesional form builder + form mail script (very cheap) cms-master.com General Advertisements 0 05-13-04 09:58 AM
Please assist. My public email request form is under siege! AshleyQuick Perl 1 05-10-04 02:54 AM


All times are GMT -5. The time now is 05:30 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.