ok so I am working on an RSS feed, but I have some questions on some things that I am not sure how to go about it.
right now I have
function getRSS($rss_url)
{
$content = file_get_contents($rss_url);
$xml = new SimpleXmlElement($content);
foreach($xml->channel->item as $entry)
{
echo "<a href='$entry->link' title='$entry->title'>" . $entry->title . "</a></br>";
}
}
This displays the RSS from a URL, but I want to be able use a form to post the link which will go to a text file.
This is the function I have for making the links go to the text file
function createRSS()
{
$filename = "rss.txt";
$text = $_POST['rssURL'];
$fp = fopen($filename, "a+");
if (!$fp)
{
echo ('File was not written');
} else {
fwrite ($fp, $text."\n");
fclose ($fp);
echo 'File written </br>';
}
}
With this function, it creates the text file and inputs w/e I put in the text field, but I want to be able to retrieve each link separately to be able to display the RSS, and I want to be able to delete an RSS if I want to.
Could anyone point me into the right direction?
Thanks!