PoisonCode

americannaziparty.com

Jul 7th, 2012
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php
  2. error_reporting(0); //hide script errors
  3.  
  4. require($_SERVER['DOCUMENT_ROOT'] . '/reports-cmp/connect.php');
  5. include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/top.inc');
  6.  
  7. // query database for all posts, order by date
  8. $query = "SELECT DATE_FORMAT(post_date,'%M %d, %Y'), post_message FROM posts ORDER BY post_date DESC LIMIT 1";
  9. $result = @ mysql_query($query) or die('<p style="color: rex">There was a database query error.</p>');
  10.  
  11. // retrieve data
  12. $data = @ mysql_fetch_row($result);
  13.  
  14. // check that data is able to be accessed
  15. if (!$data) {
  16. echo '<p class="reportError">There was an error displaying the report.</p>';
  17.  
  18. exit();
  19. }
  20. else {
  21. // display report
  22. $data['post_message'] = strip_tags($data[1]);
  23.  
  24. // report text
  25. echo "<div id=\"reportText\"><h2 style=\"font-size: 125%\">ANP Report for " . $data[0] . "</h2>";
  26. 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>";
  27. }
  28.  
  29. include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/bottom.inc');
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment