Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0); //hide script errors
- require($_SERVER['DOCUMENT_ROOT'] . '/reports-cmp/connect.php');
- include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/top.inc');
- // query database for all posts, order by date
- $query = "SELECT DATE_FORMAT(post_date,'%M %d, %Y'), post_message FROM posts ORDER BY post_date DESC LIMIT 1";
- $result = @ mysql_query($query) or die('<p style="color: rex">There was a database query error.</p>');
- // retrieve data
- $data = @ mysql_fetch_row($result);
- // check that data is able to be accessed
- if (!$data) {
- echo '<p class="reportError">There was an error displaying the report.</p>';
- exit();
- }
- else {
- // display report
- $data['post_message'] = strip_tags($data[1]);
- // report text
- echo "<div id=\"reportText\"><h2 style=\"font-size: 125%\">ANP Report for " . $data[0] . "</h2>";
- echo nl2br($data['post_message']) . "<p style=\"position: relative; text-align: center; margin-top: 32px\"><a href=\"archives.php\">ANP Report Archives</a></p></div>";
- }
- include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/bottom.inc');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment