个人站长制做网页常用的php代码

  作者:bea

代码如下: <?php $str=file("http://tq.tom.com/china/index.html"); $count=count($str); for($i=0;$i<$count;$i++){ $file.=$str[$i]; } $tomtq=explode("<tablewidth="774"border="0"cellspacing="1"cellpadding="1"bgcolor="#ABABAB">",$

代码如下:


<?php 
$str = file("http://tq.tom.com/china/index.html"); 
$count = count($str); 
for ($i=0;$i<$count;$i++){  
    $file .= $str[$i]; 

$tomtq = explode("<table width="774" border="0" cellspacing="1" cellpadding="1" bgcolor="#ABABAB">",$file); 
$tomtq = explode("</table>",$tomtq[1]); 
$tomtq= $tomtq[0]; 
//$tomtq tom天气小偷 
?> 



天气预报 code来的







<meta http-equiv="Content-Type" c>

<title>天气预报</title>
<style type="text/css">
<!--
td {
font-size: 12px;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
var openW;

function openWindow(theURL,winName,features) { //v2.0
//openW=window.open(theURL,winName,features);
//var mxh2 = window.open("about:blank","window_mxh")
//var mxh2 =window.open(theURL,winName,features);
window.showModalDialog(theURL,test(),'dialogHeight:270px;dialogWidth:265px;scroll:no;status:no')
}
function test(){
location.href="index.htm";

}
//-->
</script>

<script language="javascript" id="objscript"></script>
<script language="JavaScript" type="text/JavaScript" src="http://www.116.com.cn/116/home/weather/public.js"></script>
<script language="JavaScript" type="text/JavaScript" src="http://www.116.com.cn/116/home/weather/weather.js"></script>
<script language="JavaScript" type="text/JavaScript" src="http://jsp.116.com.cn/notice/iptocityid.jsp"></script>
<script language="JavaScript">


var locid;
var cityname;
var defid;

if(getCookie("defid")=='')
{
locid=CityID;


setCookie("defid",CityID);

}else
{
locid=getCookie("defid");

}
var havecheck;
if(getCookie("check")==''){
havecheck='2';
}else{
havecheck=getCookie("check");
}
var show;
if(havecheck=='0'){
locid=getCookie("CityID");

show=0;
}else {
locid=getCookie("defid");

show=1;
}

var urlstr = "http://jsp.116.com.cn/weather/"+locid+".js";

document.all["objscript"].src = urlstr;
//var oWea = new makeWeatherObj();

</script>

<body topmargin="0" leftmargin="0" style="background-color=transparent">
<SCRIPT language="javascript">
var oWea = new makeWeatherObj();
</script>
<div align="center">
<table width="180" height="52" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><table width="139" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="53" rowspan="2" align="center"><SCRIPT language="javascript">
var weather24=oWea.swWeather24.split("-");
document.write("<img src=http://www.116.com.cn/116/home/weather/images/icons/"+transTab(weather24[0])+"_small.gif border='0'>");
if(weather24.length==2) document.write("<img src=http://www.116.com.cn/116/home/weather/images/icons/"+transTab(weather24[1])+"_small.gif border='0'>");
</script></td>
<td width="86" align="center"><font color="#ff6600">
<SCRIPT language="javascript">
document.write(oWea.swName);
</script>
</font></td>
</tr>
<tr>
<td align="center"><SCRIPT language="javascript">
var wendu=oWea.swWendu24.split("-");
document.write("<span class='f12blue2'>"+wendu[0]+"</span>");
</script></td>
</tr>
</table></td>
</tr>
</table>
</div>




[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行]




有用  |  无用

猜你喜欢