Problem With Forms PHP

Hi guys I’m new to this. I tried to post this yesterday,thought it posted but don’t see it today. this is my problem: This is my first try at php.I have a contact form with: First Name, Last Name, Email, Comments, a checkbox for newsletter, and a couple of buttons to reset and to submit. It works but does not send the the comment section or the or the check box.Being my first time working with php I’m stuck, and the band is really needing me to get this done. Any help would be greatly appreciated! Thank you! I did this with dreamweaver.
Thanks again!

Code Below:


php:

[php]

Comments <?php $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $comments = $_POST['comments']; $newsletter = $_POST['newsletter']; //Sending Email to form owner $header = "From: $email\n" . "Reply-To: $email\n"; $subject = "Submission From My Form"; $email_to = "[email protected]"; $message = "name: $fname . $lname\n" . "email: $email\n"; mail($email_to, $subject ,$message ,$header ) ; ?>

[/php]

html:

<form id="form1" name="form1" method="post" action="result.php"> <table width="100%" border="5"> <tr> <td><div align="right"> <label for="fname">First Name:</label> </div></td> <td><div align="left"> <input type="text" name="fname" id="fname" /> </div></td> </tr> <tr> <td><div align="right"> <label for="lname">Last Name:</label> </div></td> <td><div align="left"> <input name="lname" type="text" id="lname" maxlength="25" /> </div></td> </tr> <tr> <td><div align="right"> <label for="email">Emai:l</label> </div></td> <td><div align="left"> <input type="text" name="email" id="email" /> </div></td> </tr> <tr> <td><div align="right"></div></td> <td><div align="left"></div></td> </tr> <tr>

Are you sure you posted all the code for the form, cause half of the inputs are not even in what you posted. The reason the comments and newsletter info isn’t coming through the email is cause you never added it in to the $message area before the mail()

I also have just posted a fully functional contact form that you may like at http://amecms.com/view-article.php?article=20

Yep that’s it. I tried to download the link you you posted, but it says the file wasn’t there. could you post me the code here please.

Thanks fastsol That worked!

Can’t believe I overlooked that. Thanks again

Sponsor our Newsletter | Privacy Policy | Terms of Service