PHP高手,帮忙!

darkhorse00000111 2007-04-24 04:39:08
尊敬的大侠们:

在下急需做一个新闻组(NewsGroup)的附件下载系统,由于是嵌入B/S应用,而且客户要求

必须使用PHP,于是在网上搜寻一气,结果……太失望了!

http://blog.csdn.net/feel8/archive/2004/10/27/155368.aspx

照着上面地址所附例子做了一个,然而浏览器中的结果却是:

Connection succeed.

200 news.yaako.com InterNetNews NNRP server INN 2.3.2 ready (posting ok).

First :

Last :



好失败噢,各位大侠,帮帮忙来。感激不尽!



MyEmail: Lee_f_zhao@126.com Lee_f_zhao@hotmail.com

...全文
237 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Thaiki 2007-04-25
  • 打赏
  • 举报
回复
在下比较菜 对协议没什么研究!
darkhorse00000111 2007-04-25
  • 打赏
  • 举报
回复
在下的意思是:按照网上提供的示例,达不到要求
主要功能是从新闻组下载文件(邮件或附件),使用的是NNTP协议

我写的php代码是:
<?php


$cfgServer = "news.yaako.com";

$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 "Connection failed.";
exit();
}
else {
echo "Connection succeed.";
//$tmp = fgets($usenet_handle, 1024);
}




//将脚本执行时间设置为无限制(默认为30秒)
set_time_limit(0);

//$cfgUser = "0000000803";
//$cfgPasswd = "0000000803";



$cfgNewsGroup = "alt.12hr";

// identification required on private server





// select newsgroup














fputs($usenet_handle, "GROUP ".$cfgNewsGroup."\n");
$tmp = fgets($usenet_handle, 1024);



if($tmp == "480 Authentication required for commandrn") {
echo $tmp;
exit();
}else{
echo $tmp;
}

fputs($usenet_handle,"LIST");
$temp = fgets($usenet_handle,1024);
echo $temp;


$info = split(" ", $temp);
$first = $info[2];
$last = $info[3];
printf("<br>First : %s", $first);
printf("<br>Last : %s<br>", $last);











?>





iasky 2007-04-25
  • 打赏
  • 举报
回复
“必须使用PHP,于是在网上搜寻一气,结果……太失望了! ”

这个什么意思?
szjq 2007-04-24
  • 打赏
  • 举报
回复
楼主,附件下载上传不难呀
半天不到就可以解决
lfy2b 2007-04-24
  • 打赏
  • 举报
回复
mrshelly 2007-04-24
  • 打赏
  • 举报
回复
ASP养成了 搜代码改代码的习惯了.

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧