I feel a bit of a fraud to burden you with a same ol question about WSOD and a mystery Unexpected T_String in line 1, but try as I might I cannot work this out. I'm very new... this is my first use of PHP in about 5 years and back then it realy was my first attempt which, happily worked.
I'm creating a simple website which will have a Contact Us form... its going to ask in the HTML div main as follows:
<div id="wrap">
<!.. various code that works just fine >
<div id="main">
<form action="mail.php" method="POST">
<p>Name</p> <input type="text" name="name">
<p>Email Address</p> <input type="text" name="email">
<p>Message</p> <textarea name="message" rows="6" cols="25"> </textarea>
<br />
<input type="submit" value="Send"><input type="reset" value="Clear">
</form>
</div> <!.. end of main>
<!.. some more code that also works fine>
</div> <!..end of wrap>
Within the file called main.php I have written (well, copied from a website):
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Contact Us PHP</title>
</head>
<body>
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent = "From: $name \n Message: $message";
$recipient = "my.name@mybusiness.co.uk";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You for your message " . " - " .
"<a href='www.mybusinessname.co.uk/index.html'> Return Home </a>";
?>
</body>
</html>
I have loaded this to my hosted server and when I press my Submit Button the WSOD appears showing the address http://www.mybusinessname.co.uk .... /main.php
I have spent days reading up about various possible solutions that lose me quite quickly, but honestly I think i have done something basic that has a really simple solution, and someone much cleverer than me will be able to identify this pretty quickly.