function deleteArticle($articleToDeleteId) { $webClass = new WebClass(); $query = "delete from 2s2h_news where id=\"{$articleToDeleteId}\""; $result = $webClass->executeQuery($query); if ($result) { echo "<p>ARTICLE DELETED</p>"; } else { echo "<p>ARTICLE NOT DELETED</p>"; } /* back button */ echo "\n <form action=adminpage.php method=post>\n <center>\n <input type=submit value=back>\n </center>\n </form>"; }
<?php header("Content-type: text/xml"); require '../functions/WebClass.php'; $link = "http://www.2s2h.com/2steps-2hell-news.php"; echo "<?xml version='1.0' encoding='ISO-8859-1'?>\n <rss version='2.0'>\n <channel>\n <title>2s2h news</title>\n <link>" . $link . "</link>\n <description>2Step2Hell's news</description>"; $webClass = new WebClass(); $newsQuery = "SELECT * FROM 2s2h_news ORDER BY 2s2h_news.time DESC;"; $result = $webClass->executeQuery($newsQuery); if ($result) { while ($row = mysql_fetch_assoc($result)) { $id = $row['id']; $title = $row['title']; $weblink = $link . "#" . $id; $article = html_entity_decode($row['article']); $author = $row['author']; $pubdate = $row['time']; echo "<item>\n <title>" . $title . "</title>\n <link>" . $weblink . "</link>\n <description><![CDATA[" . nl2br($article) . "]]></description>\n <author>" . $author . "</author>\n <pubDate>" . $pubdate . "</pubDate>\n </item>"; } // finish rss file echo "</channel>\n </rss>"; } $webClass->close();