My site diet-book.org has a contact for here: http://diet-book.org/contact.php The problem is when the form is submitted I only get a blank email with no subject or body. Can anyone tell me how to fix this? I think the form uses a coniguration.php file and a contact.php file. Thanks for the assistance ..
the form goes to a file called "submit.php"... you would have to show the code in this file for anyone to be able to fix it for you
Thanks here is the code, looks good to me but can you see something out of place? <?php // headers for the email listed below $headers .= "From: $name <$email>\n"; // your email client will show the person's email address like normal $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; // sets the mime type $recipient = "me@me.com (yes I have changed this)"; // enter YOUR email address here $subject = "Email from your Ebook Website"; // this is the subject of the email $msg = wordwrap( $msg, 1024 ); mail($recipient, $subject, stripslashes($msg), $headers); // the mail() function sends the message to you //Once the data is entered, redirect the user to give them visual confirmation header("location: thanks.php"); ?> PHP:
Below is the form code. I don' t know if I got the email from wordwrap or not, I just get blank emails, that do (come to think of it) have the subject intact "Email from your Ebook Website" but the emails are blank (no body text). <html><head><meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> <?php include('configuration.php'); ?> <title><?php title() ?>Contact Us</title> <?php metatags() ?> <?php css() ?></head> <?php bodytag() ?> <?php topheader() ?> <table border=0 cellspacing=0 cellpadding=0 width=100% class=back2> <tr valign=top><td width=100%><span style="font-size:12"> <center><span style="font-size:24"><font color=#00008B><b>contact us</b></font></span></center> <center><img border="0" src="/images/slimming2.jpg" width=200 height=150 alt="Buy slimming ebooks"></center><p> <form name="form" method="post" action="submit.php"> <table width="450" border="0" cellpadding="2" cellspacing="2" summary=""> <tr> <td width="100%" valign="top" align="left"><span style="font-size:12"><b>Your Name: </b><br> <input type="text" name="name" size="30" maxlength="60" /> </td> </tr> <tr> <td width="100%" valign="top" align="left"><span style="font-size:12"><b>Your Email Address:</b><br> <input type="text" name="email" size="30" maxlength="60" /> </td> </tr> <tr> <td width="250" valign="top" align="left"> <span style="font-size:12"><b>Your Message:</b><br> <textarea name="msg" cols="50" rows="10"></textarea> </td> </tr> <tr> <td width="250" valign="top" align="left"> <input type="submit" name="Send" value="Send Email" /> </td> </tr> </table> </form> </td></tr></table> <?php footer() ?> </body></html> PHP:
try putting this for the wordwrap line $msg = wordwrap( $_POST["msg"], 1024 ); Code (markup): and you might also want to check that the email it says its being sent from is the email you type in your form as well.. so you may want to change this line as well to this code: $headers .= "From: $_POST["name"] <$_POST["email"]>\n"; Code (markup):
oops... it should be like this... $headers .= "From: " . $_POST["name"] . " <" . $_POST["email"] . ">\n"; Code (markup):