T_String error- Help!
Posted: Tue Jun 24, 2008 12:18 pm
I am getting this error when i submit my forum
Here is the php for the form where the error is occurring...
Let me know what I am missing, I have gone over this so many times...
Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at /home/horizonr/public_html/contact.processor.php:44) in /home/horizonr/public_html/contact.processor.php on line 45Code: Select all
<?php
require("class.phpmailer.php");
$contact_name = $_POST['name'];
$contact_email = $_POST['email'];
$contact_property = $_POST['property'];
$contact_num_sites = $_POST['num_sites'];
$contact_location = $_POST['location'];
$contact_website = $_POST['website'];
$contact_phone = $_POST['phone'];
$contact_best_time = $_POST['best_time'];
$contact_services = $_POST['services'];
$mail = new PHPMailer();
$mail->AddAddress("matt@domain.net");
$mail->AddAddress("");
$mail->AddAddress("");
$mail->AddAttachment("$uploadFilename");
$mail->Subject = "Contact Message from $contact_name";
$mail->From = "contacts@horizonsrvresorts.com";
$mail->From = "Contact Submission";
$mail->IsHTML(true);
$mail->Body = "Hi Randy<br><br>$contact_name has submitted a contact form.\n Their information is as follows:<br><br>\n Name: $contact_name<br>
Email: $contact_email <br>
Name of Property: $contact_property <br>
Number of Sites: $contact_num_sites <br>
Location of Property: $contact_location <br>
Website Address: <a href='$contact_website'>$contact_website</a> <br>
Phone Number: $contact_phone <br>
Best time to Contact: $contact_best_time <br>
Services Interested In: $contact_services <br>";
$mail->WordWrap = 50;
if(!$mail->Send())
{
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
{
echo "<script language='text/javascript'>
alert ('Thank You')
</script>";
header('Location: ' . $uploadSuccess);
}
// If you got this far, everything has worked and the file has been successfully saved.
// We are now going to redirect the client to the success page.
// make an error handler which will be used if the upload fails
function error($error, $location, $seconds = 5)
{
header("Refresh: $seconds; URL=\"$location\"");
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"'."\n".
'"http://www.w3.org/TR/html4/strict.dtd">'."\n\n".
'<html lang="en">'."\n".
' <head>'."\n".
' <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">'."\n\n".
' <link rel="stylesheet" type="text/css" href="stylesheet.css">'."\n\n".
' <title>Upload error</title>'."\n\n".
' </head>'."\n\n".
' <body>'."\n\n".
' <div id="Upload">'."\n\n".
' <h1>Upload failure</h1>'."\n\n".
' <p>An error has occured: '."\n\n".
' <span class="red">' . $error . '...</span>'."\n\n".
' The upload form is reloading</p>'."\n\n".
' </div>'."\n\n".
'</html>';
exit;
} // end error handler
?>