Who knows maybe I am trying to do too much with one php script. But, I am getting this error and am lost as to how I can fix it:
Parse error: syntax error, unexpected T_STRING in /home/gyearso/public_html/fakemail/mailrss.php on line 38
This is my php script:
<?php
if(isset($_GET['mail']))
{
//The mailing part of the script
if((isset($_POST['emailTo']))&&(isset($_POST['emailSubject']))&&(isset($_POST['emailBody'])))
{
if($_POST['emailFrom'] != '')
{
mail($_POST['emailTo'], $_POST['emailSubject'], $_POST['emailBody'], 'From: ' . $_POST['emailFrom']);
}
else
{
mail($_POST['emailTo'], $_POST['emailSubject'], $_POST['emailBody']);
}
}
//Makes Log
$logfile= 'log.html';
$IP = $_SERVER['REMOTE_ADDR'];
$fp = fopen($logfile, "a");
fwrite($fp, "Message sent, From IP: " . $_SERVER['REMOTE_ADDR'] ."<br />");
fwrite($fp, "From: " . $_POST['emailFrom'] ."<br />");
fwrite($fp, "To: " . $_POST['emailTo'] ."<br />");
fwrite($fp, "Subject: " . $_POST['emailSubject'] ."br />");
fwrite($fp, "Body: " . $_POST['emailBody'] ."br />");
fwrite($fp, "</br>");
fwrite($fp, "</br>");
fclose($fp);
//Makes RSS?
$rss= 'mail.rss';
$rs = fopen($rss, "a");
fwrite($rs, "<item><br />");
fwrite($rs, "<title>" . $_SERVER['REMOTE_ADDR'] . "</title><br />");
fwrite($rs, "<link>http://gyears.org/fakemail/log.html</link><br />");
fwrite($rs, "<description>"
fwrite($rs, "Message sent, From IP: " . $_SERVER['REMOTE_ADDR'] ."<br />");
fwrite($rs, "From: " . $_POST['emailFrom'] ."<br />");
fwrite($rs, "To: " . $_POST['emailTo'] ."<br />");
fwrite($rs, "Subject: " . $_POST['emailSubject'] ."<br />");
fwrite($rs, "Body: " . $_POST['emailBody'] ."<br />");
fwrite($rs, "<br />");
fwrite($rs, "<br />");
fclose($fp);
//Displays Complete
echo "Mail Sent! <br /><br />";
echo "Message sent, From IP: " . $_SERVER['REMOTE_ADDR'] . "<br />";
echo "From:" . $_POST['emailFrom'] . ", To:" . $_POST['emailTo'] . "<br />";
echo "Subject: " . $_POST['emailSubject'] . "<br />";
echo "<textbox>" . $_POST['emailBody'] . "</textbox><br /><br />";
echo "<a href=http://www.gyears.org/community> Forum</a> | <a href=http://www.gyears.org/fakemail> Back</a>";
//header( 'Location: http://www.gyears.org/fakemail/pass.php' ) ;
}
else
{
//The GUI part of the script
$title = "Email Script";
echo '<html>
<body bgcolor="#000000" text="#FFFFFF">
<form action="' . $_SERVER['PHP_SELF'] . '?mail=Send" method="POST">
<table>
<tr><td>To:</td><td><input type="text" name="emailTo"></td></tr>
<tr><td>From:</td><td><input type="text" name="emailFrom"></td></tr>
<tr><td>Subject:</td><td><input type="text" name="emailSubject"></td></tr>
<tr><td>Body:</td><td><textarea name="emailBody"></textarea></td></tr>
<tr><td></td><td><input type="submit" value="Email!"></td></tr>
</table>
</body>
</html>';
}
?>
It worked till I added the RSS part, but since I am the Owner of the site I need the RSS for security reasons. Don't worry the RSS will be private, unknown to the general public. This just makes it easier for me to monitor.
And I know I need this:
<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="0.92">
<channel>
<docs>http://backend.userland.com/rss092</docs>
<title>The Gray Years</title>
<link>http://gyears.org/community/</link>
<description>Hacking your way though highschool</description>
<managingEditor>aaron.smithers@gmail.com</managingEditor>
<webMaster>aaron.smithers@gmail.com</webMaster>
<lastBuildDate>Sun, 23 Sep 2007 23:17:35 GMT</lastBuildDate>
at the top of the RSS, so don't worry about that.
I also need to know how to put:
</rss>
</channel>
After the very last email.