Newsgroup Problem

Ok the below code connects to the newsgroup server so how do I change it to
post to a newsgroup?

Thanks
Tim


$cfgServer = "news.aliant.net";
$cfgPort = 119;
$cfgTimeOut = 10;

// open a socket
if(!$cfgTimeOut)
// without timeout
$usenet_handle = fsockopen($cfgServer, $cfgPort);
else
// with timeout
$usenet_handle = fsockopen($cfgServer, $cfgPort, &$errno, &$errstr,
$cfgTimeOut);

if(!$usenet_handle) {
echo "Connexion failed\n";
exit();
}
else {
echo "Connected\n";
$tmp = fgets($usenet_handle, 1024);
}
The Newfoundland Shop [ Di, 24 Juli 2007 16:41 ] [ ID #1777268 ]

Re: Newsgroup Problem

On Tue, 24 Jul 2007 16:41:05 +0200, The Newfoundland Shopper =

<admin [at] nlshopper.ca> wrote:

> Ok the below code connects to the newsgroup server so how do I change =
it =

> to
> post to a newsgroup?
>
> Thanks
> Tim
>
>
> $cfgServer =3D "news.aliant.net";
> $cfgPort =3D 119;
> $cfgTimeOut =3D 10;
>
> // open a socket
> if(!$cfgTimeOut)
> // without timeout
> $usenet_handle =3D fsockopen($cfgServer, $cfgPort);
> else
> // with timeout
> $usenet_handle =3D fsockopen($cfgServer, $cfgPort, &$errno, &$errs=
tr,
> $cfgTimeOut);
>
> if(!$usenet_handle) {
> echo "Connexion failed\n";
> exit();
> }
> else {
> echo "Connected\n";
> $tmp =3D fgets($usenet_handle, 1024);
> }


http://www.faqs.org/docs/linux_network/x-087-2-nntp.protocol .html
-> 22.1.6. Posting an Article

Pretty much the same kind of header/body format as email, just examine a=
=

normal usenet posting for the headers you think you need. Be sure to use=
=

alt.test or similar when testing offcourse, or people might be pissed of=
f =

:P

-- =

Rik Wasmus
luiheidsgoeroe [ Di, 24 Juli 2007 16:52 ] [ ID #1777269 ]
PHP » alt.php » Newsgroup Problem

Vorheriges Thema: Passwording a PHP page
Nächstes Thema: Need a php script that posts to a newsgroup