Net_NNTP
[ class tree: Net_NNTP ] [ index: Net_NNTP ] [ all elements ]

Source for file read.php

Documentation is available at read.php

  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. // |          Heino H. Gehlsen <heino@gehlsen.dk>                         |
  18. // +----------------------------------------------------------------------+
  19. //
  20. // $Id: read.php,v 1.2.4.1 2005/01/14 17:10:17 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/Client.php";
  30.  
  31. $nntp = new Net_NNTP_Client();
  32.  
  33. $ret $nntp->connect("news.php.net");
  34. ifPEAR::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.             $header $nntp->getHeaderRaw($_GET['msgid']);
  44.             echo '<hr>';
  45.             echo '<h2>Header</h2>';
  46.             echo '<pre>';
  47.             foreach$header as $line{
  48.                 echo $line.'<br>';
  49.             }              
  50.             echo '</pre>';
  51.             echo '<hr>';
  52.             echo '<h2>Body</h2>';
  53.             echo '<form><textarea wrap="off" cols="79", rows="25">'.
  54.                     $nntp->getBodyRaw($_GET['msgid']true).
  55.                 '</textarea></form>';           
  56.         }        
  57.     else {
  58.         echo '<font color="red">No message choosed!</font><br>' ;    
  59.     }
  60.     $nntp->quit();
  61. }    
  62. ?>
  63. </body>
  64. </html>

Documentation generated on Mon, 11 Mar 2019 14:20:53 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.