|
Posted by Rik on 07/24/07 14:52
On Tue, 24 Jul 2007 16:41:05 +0200, The Newfoundland Shopper =
<admin@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
Navigation:
[Reply to this message]
|