Forum Moderators: coopster
I know I am missing something but not sure what so I have included a bit of info below: .
From the form: The submit action is below:
<td><input type="submit" name="submit" value="Submit" /></td>
PHP Form Processing File:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
// Pick up the form data and assign it to variables
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
// Build the email (replace the address in the $to section with your own)
$to = '#*$!#*$!@yahoo.com';
$subject = "New Message: $topic";
$message = "$name said: $comments";
$headers = "From: $email";
// Send the mail using PHPs mail() function
mail($to, $subject, $message, $headers);
// Redirect
header("Location: [#*$!#*$!x.com...]
?>
Error Message:
Line 19 is the header line:
Warning: Cannot modify header information - headers already sent by (output started at /home/supersk/public_html/#*$!#*$!.com/contact_us/process_form.php:3) in /home/supersk/public_html/#*$!#*$!.com/contact_us/process_form.php on line 19
I feel so stupid and know that it will take seconds for someone to spot my error, back after hours of reading, testing and making zero headway. I thought I would ask for help. (Thanks in advance)
Russ
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP
Another solution: Edit your php.ini and allow for output buffering (OB), don't forget to restart Apache.
then you may send any header from where ever :)