<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<table width="700" borderColorDark="#ffffff" borderColorLight="#008000" border="1" cellspacing="0" cellpadding="1" align="center">
<?php
/**
* @author hopboy
* @copyright 2009
*/
$url = "http://qq.ip138.com/weather/hubei/ShiYan.htm"; //目标站点
$fp = @fopen($url,"r") or die ("连接超时");
$fcontents = file_get_contents($url);
ereg("<table width=\"700\" borderColorDark=\"#ffffff\" borderColorLight=\"#008000\" border=\"1\" cellspacing=\"0\" cellpadding=\"1\" align=\"center\">(.*)<div id=\"phonezip\">",$fcontents,$rg);
$rg[1] = str_replace("src=\"/image/","src=\"http://qq.ip138.com/image/",$rg[1]);
//ereg();
echo $rg[1];
?>
</body>
</html>
以上代码保存为:weather.php文件
嵌入办法:
将weather.php上传至服务器到weather文件夹,这里必须支持PHP
代码嵌入方式
<iframe height="42%" width="100%" scrolling=auto frameborder=1 name="main" src="weather/weather.php"></iframe>
将以上代码嵌入
如果服务器不支持~~
请嵌入如下代码~
以下代码可以维持2年!
<iframe height="42%" width="100%" scrolling=auto frameborder=1 name="main" src="http://hopboy.host104.datanj.cn/weather/weather.php"></iframe >