Hey guys this is my first post of which I think will be many. Let me explain my situation, after a great fall semester at my internship my company asked me to stay on with them and work part time through the spring semester. At first my job was to do alot of static html work. But now we want to take the dive into MySQL and PHP, they will pay me to train myself so it isn't too bad. I ran over to the local B&N and purchased "Sams Teach Yourself: PHP, MySQL, and Apache", and i have been just going through the tutorials.
So now I'am up to the point where I need to make an HTML Form and then have it send through a PHP Mailing script here is what I have.
<html>
<head>
<title>Sending mail from the form in Listing</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form actions="<?php $_SERVER["PHP_SELF"]; ?>" method="POST">
<p><strong>Name:</strong><br> <input type ="text" size ="25"
name="name" />
</p>
<p><strong>Email:</strong><br>
<input type ="text" size ="25"
name="email" />
</p>
<p><strong>Subject:</strong><br>
<input type ="text" size ="25"
name="subject" />
</p>
<p><strong> Message:</strong><br>
<textarea name="message" cols="30" rows="5"></textarea>
</p>
<p><input type="submit" value="send" />
</p>
</form>
<?php
echo "<p>Thank You, <b>".$_POST["name"]."<b/>, for your message!</p>";
echo "<p> Your email address is: <b>".$_POST["email"]."</b>.</p>";
echo "<p> Your message was:<br/>";
echo $_POST["message"]."</p>;
$msg = "Name: ".$_POST["name"]."\n"; //Line of Code that is a problem
$msg .= "Email: ".$_POST["email"]."\n";
$msg .= "Message: ".$_POST["message"]."\n";
$recipient = "xxxxx@gmail.com";
$subject = ".$_POST["subject"];
$mailheaders = "From: StormMagazine.com Test Website \n";
$mailheaders = "Reply-To: ".$_POST["email"];
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html>
My first question is can I have the mailing script in the same code with the HTML form and use the <form actions="<?php $_SERVER["PHP_SELF"]; ?> to read itself?
When I do run the page it keeps coming back with this little error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /usr/home/stormmag/public_html/Steve/sendmail.php on line 30
I'm sorry for the long winded post. I read the forum rules and I believe this is the etiquette if not your help is greatly appreciated. Thanks guys