i made a form mail but when i send it
i will get this error
Warning: Cannot modify header information - headers already sent by (output started at /home/flash-heaven/public_html/test/sendmail.php:9) in /home/flash-heaven/public_html/test/sendmail.php on line 38
i use 2 php files
sendmail.php
<? $subj = $_POST['subj']; // Get the subject $name = $_POST['name']; // Get the name $email = $_POST['email']; // Get the e-mail $site = $_POST['url']; // Get the url $comments = $_POST['comments']; // Get the message $ip = $_SERVER[REMOTE_ADDR]; // Get the IP $host = GetHostByAddr($ip); // Get the host // Set some variables for the date $day = date("l"); $date = date("j of F"); $year = date("Y"); $time = date("g:i A"); $to = "[email protected]"; // Your e-mail $subject = "¡Form Mailer! $subj"; // The subject // Set some header info $headers = "To: Your Name \r\n"; $headers .= "From: $name <$email>\r\n"; // Don't change $headers .= "Reply-To: $email\r\n"; // Don't change // The next line is the actual body of the e-mail, $body = "Name: $name\r\nE-Mail: $email\r\nWebsite: $site\r\n Comments:\r\n$comments\r\n\n---Info---\r\n IP: $ip@$host\r\nDate: $day the $date, $year\nTime: $time"; mail($to,$subject,$body,$headers); // Let's send the e-mail! header("Location: sendmail.php"); // After the mail has been sent, redirect the visitor to a new pageand mail.php
<p> </p> <form action="sendmail.php" method="post"> <span style="font-size: 8pt;">Your E-Mail:</span><br /> <input type="text" name="email" value="" > <br /><br /> <span style="font-size: 8pt;">Your Name:</span><br /> <input type="text" name="name" value="" > <br /><br /> <span style="font-size: 8pt;">Your Website:</span><br /> <input type="text" name="url" value="" > <br /><br /> <span style="font-size: 8pt;">Subject [Please fill in, or your E-Mail may be ignored]:</span><br /> <input type="text" name="subj" value="" > <br /><br /> <span style="font-size: 8pt;">Comments:</span><br /> <textarea name="comments" rows="5" ></textarea> <br/ ><br /> <input type="submit" value="Send E-Mail"> </form>
but i can find it help me plzz