khujo56
Members-
Posts
24 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
khujo56's Achievements
Newbie (1/5)
0
Reputation
-
i fixed there error but now i get this error when i click submit Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/n/r/jnr1975/html/mailer.php:31) in /home/content/j/n/r/jnr1975/html/mailer.php on line 34
-
Hi Guys Need help trying to figure out why it will not redirect to the assigned page. it says that info has been sent to assigned e-mail after the submit button has been pressed, but does not redirect to the page. below is the code. <?php if(isset($_POST['name']) && empty($_POST['name'])) { $error[] = "Post your name"; } if(isset($_POST['email']) && empty($_POST['email'])) { $error[] = "Post your name"; } if(isset($_POST['message']) && empty($_POST['message'])) { $error[] = "Post your name"; } if(is_array($error)) { echo("errors:<br>"); foreach($error as $x => $i) { echo("- ".$i."<br>"); } } else { $to = "email@here.com"; $subject = "subject"; $message = $_POST['message']; $name = $_POST['name']; $from = $_POST['email']; mail($to, $subject, $message, "From: $name<$from>"); echo("<script>alert(\"Thanks!\nE-mail has been sent!\");</script>"); $url = "www.iheartvacation.com."; header("Location: $url"); } ?>
-
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
-
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
-
so post this on the actual html page instead of the php page?
-
HI i tried that script..when it says that the info has been sent, instead of re-directing to the assigned page, i get this message instead : Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/n/r/jnr1975/html/mailer.php:33) in /home/content/j/n/r/jnr1975/html/mailer.php on line 37
-
that does not work, sorry
-
so how would i change that ???
-
so i finally figured out that i did not have a php package for my hosting. finally switched over to php, it works fine but it does redirect to the assigned address. instead i get this message Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/n/r/jnr1975/html/mailer.php:31) in /home/content/j/n/r/jnr1975/html/mailer.php on line 34....it should redirect to the main page. below is the php script. <?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:<br>"); foreach($error as $x => $i) { echo("- ".$i."<br>"); } } 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>"); $url = "http://www.iheartvacation.com/"; header("Location: $url"); } ?>
-
the form works fine but the info does not get to my assigned address...i tried my hotmail account then i switched to my other e-mail address..neither receives any
-
is there an alternative to that. it kinda defeats the purpose of a form if the info cannot be sent to the assigned e-mail address
-
well i tried my actual e-mail address associated with my website and i still don't get anything. what could be the problem??
-
well either one works great..so thank you. now i still did not get the e-mail that i tested. is there a problem with hotmail accounts it should usually be fast.
-
is there a way you can say it has been submitted to my e-mail address then have it re-directed to a new page?
-
thanks that helped. is there a way you can write a message that is has been posted, then have it re-directed to another page..like back to the main page ?