home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / read.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  2.5 KB  |  61 lines

  1. <?php
  2. //
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Alexander Merz <alexmerz@php.net>                           |
  17. // |                                                                      |
  18. // +----------------------------------------------------------------------+
  19. //
  20. // $Id: read.php,v 1.5 2003/08/29 08:19:11 heino Exp $
  21. ?>
  22. <html>
  23. <head>
  24.     <title>NNTP news.php.net</title>
  25. </head>
  26. <body>
  27. <h1>Message</h1>
  28. <?php
  29. require_once "Net/NNTP.php";
  30.  
  31. $nntp = new Net_NNTP;
  32.  
  33. $ret = $nntp->connect("news.php.net");
  34. if( PEAR::isError($ret)) {
  35.  echo '<font color="red">No connection to newsserver!</font><br>' ;
  36.  echo $ret->getMessage();
  37. } else {
  38.     if(isset($_GET['msgid']) and isset($_GET['group'])){
  39.         $msgdata = $nntp->selectGroup($_GET['group']);
  40.         if(PEAR::isError($msgdata)) {
  41.             echo '<font color="red">'.$msgdata->getMessage().'</font><br>' ;        
  42.         } else {
  43.             $msgheader = $nntp->splitHeaders($_GET['msgid']);
  44.             echo '<h2>Headers:</h2>';
  45.             foreach( $msgheader as $headername => $headercontent) {
  46.                 echo '<b>'.$headername.'</b>: '.$headercontent."<br>";
  47.             }              
  48.             echo "<hr>";
  49.             echo '<h2>Body</h2>';
  50.             echo '<form><textarea wrap="off" cols="79", rows="25">'.
  51.                     $nntp->getBody($_GET['msgid']).
  52.                 '</textarea></form>';           
  53.         }        
  54.     } else {
  55.         echo '<font color="red">No message choosed!</font><br>' ;    
  56.     }
  57.     $nntp->quit();
  58. }    
  59. ?>
  60. </body>
  61. </html>