一个PHP做的奥运金牌排行榜程序,我没测试成功,高手过来看看 你看看我写的这个http://www.yubeinet.com/bbs/wdbread.php?forumid=15&filename=f_354&fpage= 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的那个也没什么问题啊,就是那个$result变量开始没赋值,所以抛出个NOTICE的错误而已。在开始加个$result="";就可以了 我的那个你能用吗?如果能,证明可以fopen远程文件,那你的那个程序应该也能用啊。。我在我的机器上调试,即使不修改,也能正常显示的,只是会有个notice,不过这个不要紧的。 surfchen(偶木系楼主,偶系楼猪)(JS&&C菜菜) 你的程序抓下来的挺好,只是标题栏成了黑色的了,看不到了 $total_content=$total_content."<a name=detail></a>".$content;} //看到这句了吗?在它的下面加上$total_content=str_replace("#000","#CC990F",$total_content);————————————————呵呵,不好意思,我更新的时候忘记更新站点的下载了。。现在我又无法登陆FTP更新那个下载的 是不是我的PHP版本太高了,我是5.0你的程序能运行搞不清原因了 没有发现有什么问题,显示很正常2004年08月16日 , 星期一 欢迎[ guest ]回来 奥运奖牌榜 金 银 铜 1 中国 5 2 1 2 澳大利亚 4 1 3 3 日本 4 1 0 4 意大利 2 1 0 5 土耳其 2 0 1 乌克兰 2 0 1 没找到那句话,有下面这句$yb_content=$yb_content."<a name=detail></a>".$content;我加到这下面,并修改为:$yb_content=str_replace("#000","#CC990F",$yb_content);还是不行,显示不出标题栏来,还是一条黑色的你再看看吧,要不我开个ftp,你发到我这来如何 xuzuning(唠叨) 老大,你是怎么显示出来的我的不行,使用源文件中的地址:http://2004.sina.com.cn/iframe/50/2004-08-05/9.html显示为如下所示:http://211.155.241.118:81/aoyun.php 内容为空。 我把址址改为http://2004.sina.com.cn/iframe/medals/index.shtml 时什么都显示不出来唠叨老大再看看 http://surfchen.vicp.net/yb/remote/down/yb_oly/yb_oly.phphttp://127.0.0.1/yb/remote/down/yb_oly.rar不知道这两个地址你是否可以访问如果不可以,你开个FTP给我吧,我传过去另外,我在你的站点也能看到唠叨所看到的。。你自己看不到吗? 下载地址发错了应该是这个,不过可能访问不了。。南宁地区以外的人访问好象都有问题的。。http://surfchen.vicp.net/yb/remote/down/yb_oly.rar <?PHPfunction GetHtml($Url){ $result=""; $fp = @fopen($Url, 'rb'); if ($fp){ do { $urldata = @fread($fp, 8192); if (strlen($urldata) == 0) break; $result .= $urldata; } while(true); return $result; } return false;}/*如果你的网站支持CURL使用这个!*//*function GetHtml($Url){ $ch = curl_init($Url); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); return $result;}*/$obj_url = "http://2004.sina.com.cn/iframe/medals/index.shtml";$obj_str = getHtml($obj_url);//die($obj_str);if ($obj_str){$pattern = '@';$pattern .= preg_quote('<tr>');$pattern .= '\s*';$pattern .= preg_quote('<td class=c1>');$pattern .= '(.+?)'; //1.名次$pattern .= preg_quote('</td>');$pattern .= '\s*';$pattern .= preg_quote('<td class=c2>');$pattern .= '(.+?)'; //1.国家$pattern .= preg_quote('</td>');$pattern .= '\s*';$pattern .= preg_quote('<td class=c3>');$pattern .= '(.+?)'; //1.金牌$pattern .= preg_quote('</td>');$pattern .= '\s*';$pattern .= preg_quote('<td class=c4>');$pattern .= '(.+?)'; //1.银牌$pattern .= preg_quote('</td>');$pattern .= '\s*';$pattern .= preg_quote('<td class=c5>');$pattern .= '(.+?)'; //1.铜牌$pattern .= preg_quote('</td>');$pattern .= '\s*';$pattern .= preg_quote('</tr>');$pattern .= '@ms'; if (preg_match_all($pattern, $obj_str, $matchs, PREG_SET_ORDER)) { $print = <<<WAPSHOW<table width=141 border=0 cellpadding=3 cellspacing=1 bgcolor=#333333><tr align=center bgcolor=#FFFFFF><td colspan=7 nowrap>奥运奖牌榜</td></tr><td class=t0 rowspan=7 width=10 valign=top></td><td class=t1></td><td class=t2> </td><td class=t3>金</td><td class=t4>银</td><td class=t5>铜</td><td class=t6 rowspan=7 width=12 valign=top></td>WAPSHOW;foreach ($matchs as $countryvalues){ if (!is_array($countryvalues)) continue; $mingci = trim($countryvalues[1]); $country = trim($countryvalues[2]); $gold = trim($countryvalues[3]); $silver = trim($countryvalues[4]); $copper = trim($countryvalues[5]); $print .= <<<WAPSHOW<tr align=center style="padding-top:2px"><td width=13 height=18 bgcolor=#FFFFFF nowrap>$mingci</td><td width=59 bgcolor=#CCCCCC align=left nowrap>$country</td><td width=21 bgcolor=#ffffff nowrap>$gold</td><td width=21 bgcolor=#ffffff nowrap>$silver</td><td width=21 bgcolor=#ffffff nowrap>$copper</td></tr>WAPSHOW;}$print .= <<<WAPSHOW</table>WAPSHOW;}}echo $print;?>你们试试这个程序在你的机子上能正常显示吗 http://2004.sina.com.cn/iframe/medals/index.shtml用这个的时候不得因为这个程序本身就不是用来处理这个页面的吧??如果你想引用这个,就干脆这样吧<IFRAME SRC=http://2004.sina.com.cn/iframe/medals/index.shtml FRAMEBORDER=0 ALLOWTRANSPARENCY=true SCROLLING=YES WIDTH=97% HEIGHT=600></IFRAME>直接用HTML来实现就行了。。用这个的时候没问题$obj_url = "http://2004.sina.com.cn/iframe/50/2004-08-05/9.html"; surfchen(偶木系楼主,偶系楼猪)(JS&&C菜菜):你试试我的ftpIP:211.155.241.118prot:2128user:csdn_userpw:123456如果ftp软件没法登录,就用浏览器直接访问 cuteftp和浏览器都连接不上,你现在可以来这里下了。。我已经更新好了。。http://surfchen.wegame.com/down/yb_oly.rar surfchen(偶木系楼主,偶系楼猪)(JS&&C菜菜老大,你给的地址还是下载不了你说具体改什么地方,我来动手改现在还是标题栏全是黑,没有字 这是我写的,不过还不够智能,网页变了就不准了,仅供参考<?$filen='http://sports.china.com/zh_cn/2004/include/olymgoldall.html';$fd=file($filen);$str=implode('',array_slice($fd,427,763));?><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>2004雅典奥运会--奖牌榜</title><style type="text/css"><!--body ,td,a { font-family: "宋体";font-size: 12px;line-height: 120%;color: #000000;text-decoration: none;}--></style></head><?=$str?></body></html> szjq()我就是加了那一句$yb_content=str_replace("#000","#CC990F",$yb_content);不知道你的为什么不得呢。。你现在试一下看看下不下得那个RAR? 自制一个小小的网站,其中一个功能总是有问题,求各位解答? 求助,为何我在xp下可以发邮件,而在windows2003下却发送邮件失败? 一个SQL查询问题 我用php输出了这两个完全一样的html文件,可是在浏览器中的表现却完全不一样,救命!! PHP有沒有function可以去除html code? php的数学公式生成器 Apache安装求救!! 关于登陆…… 关于From,我快没有信心了 微信支付的统一下单接口,返回的是空值,麻烦大神看看什么原因 急用,请各个高手们帮帮小弟 哪位能写一个图片上显示中文的程序?
我在我的机器上调试,即使不修改,也能正常显示的,只是会有个notice,不过这个不要紧的。
你的程序抓下来的挺好,只是标题栏成了黑色的了,看不到了
} //看到这句了吗?在它的下面加上
$total_content=str_replace("#000","#CC990F",$total_content);
————————————————
呵呵,不好意思,我更新的时候忘记更新站点的下载了。。现在我又无法登陆FTP更新那个下载的
你的程序能运行搞不清原因了
欢迎[ guest ]回来
奥运奖牌榜
金 银 铜
1 中国 5 2 1
2 澳大利亚 4 1 3
3 日本 4 1 0
4 意大利 2 1 0
5 土耳其 2 0 1
乌克兰 2 0 1
$yb_content=$yb_content."<a name=detail></a>".$content;
我加到这下面,并修改为:
$yb_content=str_replace("#000","#CC990F",$yb_content);还是不行,显示不出标题栏来,还是一条黑色的
你再看看吧,要不我开个ftp,你发到我这来如何
我的不行,使用源文件中的地址:http://2004.sina.com.cn/iframe/50/2004-08-05/9.html
显示为如下所示:http://211.155.241.118:81/aoyun.php 内容为空。
我把址址改为http://2004.sina.com.cn/iframe/medals/index.shtml 时
什么都显示不出来唠叨老大再看看
http://127.0.0.1/yb/remote/down/yb_oly.rar
不知道这两个地址你是否可以访问如果不可以,你开个FTP给我吧,我传过去另外,我在你的站点也能看到唠叨所看到的。。你自己看不到吗?
http://surfchen.vicp.net/yb/remote/down/yb_oly.rar
function GetHtml($Url)
{
$result="";
$fp = @fopen($Url, 'rb');
if ($fp){
do {
$urldata = @fread($fp, 8192);
if (strlen($urldata) == 0) break;
$result .= $urldata;
} while(true);
return $result;
}
return false;
}/*如果你的网站支持CURL使用这个!*/
/*function GetHtml($Url)
{
$ch = curl_init($Url);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_NOBODY, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}*/$obj_url = "http://2004.sina.com.cn/iframe/medals/index.shtml";$obj_str = getHtml($obj_url);
//die($obj_str);
if ($obj_str){
$pattern = '@';
$pattern .= preg_quote('<tr>');
$pattern .= '\s*';
$pattern .= preg_quote('<td class=c1>');
$pattern .= '(.+?)'; //1.名次
$pattern .= preg_quote('</td>');
$pattern .= '\s*';
$pattern .= preg_quote('<td class=c2>');
$pattern .= '(.+?)'; //1.国家
$pattern .= preg_quote('</td>');
$pattern .= '\s*';
$pattern .= preg_quote('<td class=c3>');
$pattern .= '(.+?)'; //1.金牌
$pattern .= preg_quote('</td>');
$pattern .= '\s*';
$pattern .= preg_quote('<td class=c4>');
$pattern .= '(.+?)'; //1.银牌
$pattern .= preg_quote('</td>');
$pattern .= '\s*';
$pattern .= preg_quote('<td class=c5>');
$pattern .= '(.+?)'; //1.铜牌
$pattern .= preg_quote('</td>');
$pattern .= '\s*';
$pattern .= preg_quote('</tr>');
$pattern .= '@ms';
if (preg_match_all($pattern, $obj_str, $matchs, PREG_SET_ORDER)) { $print = <<<WAPSHOW
<table width=141 border=0 cellpadding=3 cellspacing=1 bgcolor=#333333>
<tr align=center bgcolor=#FFFFFF>
<td colspan=7 nowrap>奥运奖牌榜</td>
</tr><td class=t0 rowspan=7 width=10 valign=top></td>
<td class=t1></td>
<td class=t2> </td>
<td class=t3>金</td>
<td class=t4>银</td>
<td class=t5>铜</td>
<td class=t6 rowspan=7 width=12 valign=top></td>WAPSHOW;foreach ($matchs as $countryvalues)
{
if (!is_array($countryvalues)) continue;
$mingci = trim($countryvalues[1]);
$country = trim($countryvalues[2]);
$gold = trim($countryvalues[3]);
$silver = trim($countryvalues[4]);
$copper = trim($countryvalues[5]);
$print .= <<<WAPSHOW
<tr align=center style="padding-top:2px">
<td width=13 height=18 bgcolor=#FFFFFF nowrap>$mingci</td>
<td width=59 bgcolor=#CCCCCC align=left nowrap>$country</td>
<td width=21 bgcolor=#ffffff nowrap>$gold</td>
<td width=21 bgcolor=#ffffff nowrap>$silver</td>
<td width=21 bgcolor=#ffffff nowrap>$copper</td>
</tr>
WAPSHOW;
}$print .= <<<WAPSHOW
</table>
WAPSHOW;
}
}echo $print;?>你们试试这个程序在你的机子上能正常显示吗
用这个的时候不得因为这个程序本身就不是用来处理这个页面的吧??
如果你想引用这个,就干脆这样吧
<IFRAME SRC=http://2004.sina.com.cn/iframe/medals/index.shtml FRAMEBORDER=0 ALLOWTRANSPARENCY=true SCROLLING=YES WIDTH=97% HEIGHT=600></IFRAME>
直接用HTML来实现就行了。。用这个的时候没问题
$obj_url = "http://2004.sina.com.cn/iframe/50/2004-08-05/9.html";
你试试我的ftp
IP:211.155.241.118
prot:2128
user:csdn_user
pw:123456如果ftp软件没法登录,就用浏览器直接访问
http://surfchen.wegame.com/down/yb_oly.rar
老大,你给的地址还是下载不了
你说具体改什么地方,我来动手改
现在还是标题栏全是黑,没有字
<?
$filen='http://sports.china.com/zh_cn/2004/include/olymgoldall.html';
$fd=file($filen);
$str=implode('',array_slice($fd,427,763));
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>2004雅典奥运会--奖牌榜</title>
<style type="text/css">
<!--
body ,td,a {
font-family: "宋体";font-size: 12px;line-height: 120%;color: #000000;text-decoration: none;
}
-->
</style>
</head>
<?=$str?>
</body>
</html>
我就是加了那一句
$yb_content=str_replace("#000","#CC990F",$yb_content);
不知道你的为什么不得呢。。
你现在试一下看看下不下得那个RAR?