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.6.1 2005/11/27 21:49:10 heino Exp $
  21.  
  22. $host 'news.php.net';
  23. $debug = false;
  24.  
  25. ?>
  26. <html>
  27.  
  28. <head>
  29.     <title>NNTP <?php echo $host?></title>
  30. </head>
  31.  
  32. <body>
  33. <?php
  34.  
  35. if (!isset($_GET['msgid']and isset($_GET['group'])){
  36.     echo '<font color="red">No message choosed!</font><br>' ;    
  37. }
  38.  
  39. $group $_GET['group'];
  40. $messageID $_GET['msgid'];
  41.  
  42. require_once 'Net/NNTP/Client.php';
  43.  
  44. $nntp = new Net_NNTP_Client();
  45. $nntp->setDebug($debug);
  46.  
  47. $posting $nntp->connect($host);
  48. if (PEAR::isError($posting)) {
  49.     echo '<font color="red">No connection to newsserver!</font><br>';
  50.     die($posting->getMessage());
  51. }
  52.  
  53. $currentgroup $nntp->selectGroup($group);
  54. if (PEAR::isError($currentgroup)) {
  55.     die('<font color="red">' $currentgroup->getMessage('</font><br>');
  56. }
  57.  
  58. $header $nntp->getHeader($messageID);
  59. $body $nntp->getBodyRaw($messageIDtrue);
  60.  
  61. echo '<h1>Message</h1>';
  62. echo '<hr>';
  63. echo '<h2>Header</h2>';
  64. echo '<pre>';
  65. foreach ($header->getFieldsArray(as $field{
  66.     echo $field'<br>';
  67. }              
  68. echo '</pre>';
  69. echo '<hr>';
  70. echo '<h2>Body</h2>';
  71. echo '<form><textarea wrap="off" cols="79", rows="25">'$body'</textarea></form>';
  72.  
  73. $nntp->quit();
  74.  
  75. ?>
  76. </body>
  77.  
  78. </html>

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