khujo56 Posted July 5, 2007 Author Share Posted July 5, 2007 yeah still does not work...it sends the message and does go to the re-direct page but does not tell you that is has been sent Quote Link to comment Share on other sites More sharing options...
cluce Posted July 5, 2007 Share Posted July 5, 2007 something different.......Here is a simple php contact form code that I am using on my website right now. Our website has the exact same form as yours on your website. (2 textfields and 1 text area) Just make sure you name your fields on the contact form the same as the fields in the body section of the php code. This will email blank spaces as well as text. <?php $to = "webmaster@iheartvacation.com"; $subject = "Contact form"; $body = " \n\n Name: $Name \n\n E-Mail Address: $Email \n\n Comments: $Comments"; mail ($to, $subject, $body); header("Location: http://www.iheartvacation.com/"); ?> Quote Link to comment Share on other sites More sharing options...
xyn Posted July 5, 2007 Share Posted July 5, 2007 the header() is the problem... not the code. Ok, paste your HTML form, and PHP Email script. in a reply. then we can work from it. Quote Link to comment Share on other sites More sharing options...
khujo56 Posted July 15, 2007 Author Share Posted July 15, 2007 ok here is the html for the form <form action="mailer.php" method="post" name="Form1" id="Form1" > <div class="m" style="margin-left:8px; margin-bottom:4px ">Name</div> <input name="name" type="text" id="name" style="width:290px; height:19px; font-family:Tahoma, Arial, Helvetica, sans-serif; font-size:10px; color:#848484 " onFocus="this.value=''" onClick="this.value=''" value=""> <img src="images/spacer.gif" height="4" style="display:block "> <div class="m" style="margin-left:8px; margin-bottom:4px ">E-mail</div> <input name="email" type="text" id="email" style="width:290px; height:19px; font-family:Tahoma, Arial, Helvetica, sans-serif; font-size:10px; color:#848484 " onFocus="this.value=''" onClick="this.value=''" value=""> <img src="images/spacer.gif" height="4" style="display:block "> <div class="m" style="margin-left:8px; margin-bottom:4px ">Message</div> <textarea name="message" id="message" style="width:445px; height:80px; overflow:hidden; font-family:Tahoma, Arial, Helvetica, sans-serif; font-size:10px; color:#848484 " onFocus="this.value=''" onClick="this.value=''"></textarea> <div style="padding-top:8px; margin-right:30px; margin-top:15px " align="right" class="red "><img src="images/kv.jpg" align="absmiddle" style="margin-right:5px "> <a href="#" class="red2 " onclick="javascript:document.Form1.reset();">Reset</a> <img src="images/kv.jpg" align="absmiddle" style="margin-right:5px "> <input type="submit" name="submit" value="Submit"> </div> </form here is the code for the php: <?php if(isset($_POST['name']) && empty($_POST['name'])) { $error[] = "Post your name"; } if(isset($_POST['email']) && empty($_POST['email'])) { $error[] = "Post your e-mail address"; } if(isset($_POST['message']) && empty($_POST['message'])) { $error[] = "Post your comments"; } if(is_array($error)) { echo("errors: "); foreach($error as $x => $i) { echo("- ".$i." "); } } else { $to = "webmaster@iheartvacation.com"; $subject = "subject"; $message = $_POST['message']; $name = $_POST['name']; $from = $_POST['email']; mail($to, $subject, $message, "From: $name<$from>"); echo("<script>alert(\"Thanks!\E-mail has been sent!\");</script>"); } ?> thanks Quote Link to comment 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.