Hi,
I am not a coder- I have some PHP for a contact web site page that works and when i copied it to a new site, it errors on header as follows
Warning: Cannot modify header information - headers already sent by (output started at /home/content/79/7955179/html/contact.php:5) in /home/content/79/7955179/html/contact.php on line 35
Here is the code and the error moves with the header statement
<?php $page_title = 'PurrfectPCs.'; if (isset($_POST['submitted'])) { $errors = array(); if (empty($_POST['name'])) { $errors[] = 'Fill in your name.'; } if (empty($_POST['compname'])) { $errors[] = 'Fill in your company name.'; } if (empty($_POST['subject'])) { $errors[] = 'Fill in the subject.'; } if (empty($_POST['email'])) { $errors[] = 'Fill in your e-mail address.'; } if (empty($_POST['body'])) { $errors[] = 'Fill in the body of the e-mail.'; } if (empty($errors)) { $body = "Name: {$_POST['name']}\nCompany Name: {$_POST['compname']}\nE-mail: {$_POST['email']}\nBody: {$_POST['body']}\n"; mail ('[email protected]', $_POST['subject'], $body); $URL="thankyou.htm"; header ("Location: $URL"); }else{ echo "Error!
\nThe following errors have occurred:"; foreach ($errors as $msg) { echo "
\n
Please go back and fill in the required information.
"; } }else{ ?>Any help is appreciated
but try changing out header location $url to:
