Example #1
0
<body>
<h1>Message</h1>
<?php 
require_once "Net/NNTP/Client.php";
$nntp = new Net_NNTP_Client();
$ret = $nntp->connect("news.php.net");
if (PEAR::isError($ret)) {
    echo '<font color="red">No connection to newsserver!</font><br>';
    echo $ret->getMessage();
} else {
    if (isset($_GET['msgid']) and isset($_GET['group'])) {
        $msgdata = $nntp->selectGroup($_GET['group']);
        if (PEAR::isError($msgdata)) {
            echo '<font color="red">' . $msgdata->getMessage() . '</font><br>';
        } else {
            $header = $nntp->getHeaderRaw($_GET['msgid']);
            echo '<hr>';
            echo '<h2>Header</h2>';
            echo '<pre>';
            foreach ($header as $line) {
                echo $line . '<br>';
            }
            echo '</pre>';
            echo '<hr>';
            echo '<h2>Body</h2>';
            echo '<form><textarea wrap="off" cols="79", rows="25">' . $nntp->getBodyRaw($_GET['msgid'], true) . '</textarea></form>';
        }
    } else {
        echo '<font color="red">No message choosed!</font><br>';
    }
    $nntp->quit();