Well, I am not to entirely sure about this code. This only the second time I php'd.
This code here is for my php so I can read the MYSQL as an RSS.
<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\";
// Set RSS Version
echo "<rss version=\"2.0\">";
//Start the XML
echo "
<channel>
<title>Fake Mail RSS</title>
<description>Admin RSS of Fake Mail</description>
<link>http://www.gyears.org/fakemail</link>
// Create connection to database
<?
@mysql_connect('localhost','gyearso_rss','rss') or die('ERROR--CAN'T CONNECT TO SERVER');
@mysql_select_db('gyearso_rss') or die('ERROR--CAN'T CONNECT TO DB');
?>
// Query database and select the last 20 entried
$data = mysql_query("SELECT * FROM email ORDER BY id DESC LIMIT 20");
while($row = mysql_fetch_array($data))
{
// Continue with the 20 items to be included in the <item> section of the XML.
echo "
<item>
<link>http://www.gyears.org/fakemail/mail.rss</link>
<title>".$row[ID]. .$row[IP]."</title>
<description><![CDATA["From: .$row[From].
To: .$row[To].
Subject: .$row[Subject].
Body: .$row[Body]."]]></description>
</item>
}
echo "
</channel>
</rss>";
?>
I am getting this when I try to view the RSS Feed:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/gyearso/public_html/fakemail/debug/test.php on line 6
I'm sure there may be more errors, so please take a look.