首先,http://www.baigoogledu.com/ 这个网站,我想申明俺不是想侵权哦,也看到一些人在网上需求这个网站的源码,闲的没事,就写了这个。你看人家整个网站就这些代码,其他没有了。
网站分为四个页面,完全按照他的思路来的,因为不想去设计界面,就有点丑,但还是不错滴嘿嘿
源码如下:
首页:index.html
<html>
<head>
<title>百度谷歌一下</title>
</head>
<body>
<div id="formDiv" style="z-index:1;position:absolute; top:50%; left:50%">
<form name="form1" action="s.php" method="get">
<hidden name="hl" vlaue="zh-CN" />
<input name="q" type="text"><p>
<input name="search" type="submit" value="百度谷歌一下">
</form>
</div>
</body>
查询页:s.php
<html>
<head>
<title>百度谷歌一下</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<?php
$wd="";
$start=0;
$num=10;
if(isset($_GET["start"])) $start=$_GET["start"];
if(isset($_GET["num"])) $num=$_GET["num"];
if(isset($_GET["q"])) $wd=rawurlencode($_GET["q"]);
$headURL="?q=".$wd."&start=".$start."&num=".$num;
$baiduURL=";
$googleURL=";
?>
</head>
<frameset rows=31,* framespacing=0 frameBorder=0 border=0 bordercolor="#3E77B3">
<frame border=0 name=poptoolsbar frameSpacing=0 src=head.php<?php echo $headURL ?> frameBorder=NO scrolling=no>
<frameset cols=50%,* bordercolor="#3E77B3" id=myFrame>
<frame src="<?php echo $googleURL?>" name=popforum bordercolor="#3E77B3" target="right">
<frame src="<?php echo $baiduURL?>" name=popmain bordercolor="#3E77B3">
</frameset>
<NOframeS>
</NOframeS>
</frameset>
</HTML>
查询头部:head.php
<html>
<head>
<title>百度谷歌一下</title>
<?php
$keyword="";
$wd="";
$start=0;
$num=10;
if(isset($_GET["start"])) $start=$_GET["start"];
if(isset($_GET["num"])) $num=$_GET["num"];
if(isset($_GET["q"])) $wd=rawurlencode($_GET["q"]);
if(isset($_GET["q"]))
{
$keyword=rawurldecode($_GET["q"]);
//$wd=rawurlencode($_GET["q"]);
$wd=$_GET["q"];
}
$headURL="?q=".$wd."&start=".$start."&num=".$num;
$baiduURL=";
$googleURL=";
$next="s.php?q=".$wd."&start=".($start+$num)."&num=".$num;
if($start-$num>0)
$pre="s.php?q=".$wd."&start=".($start-$num)."&num=".$num;
else
$pre="s.php?q=".$wd."&start=0&num=".$num;
?>
</head>
<body>
<FORM name="form2" action="s.php" method="get" target="parent">
<a href="index.html" target=parent>首页</a>
<a href="<?php echo $googleURL?>" target=parent>展开google</A>
<a href="<?php echo $baiduURL?>" target=parent">展开百度</a>
<input name="q" type="text" maxlength="200" size="80" value=<?php echo $keyword;?>>
<select name="num">
<option value="10">每页显示10条</option>
<option value="20">每页显示20条</option>
<option value="50">每页显示50条</option>
<option value="100">每页显示100条</option>
</select>
<input name="search" type="submit" value="搜索" >
<?php
if($start>0)
{
?>
<a href="<?php echo $pre?>" target=_top>上一页</a>
<?php
}
?>
<a href="<?php echo $next ?>" target=_top>下一页</a>
<a href="#" onClick="javascript:window.external.AddFavorite('http://user.qzone.qq.com/1013514858/infocenter/', '百度Google一下')">收藏本站</a> <a href=suggestions.html target=_blank>提点建议</a>
</form>
</body>
</html>
建议联系:suggestions.html
<html>
<head>
<title>Suggest a feature</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
p {
font-size: 18px;
}
-->
</style></head>
<body>
<p><br><b>
[联系方式]</b>
<br><br>
Email:chenbo1207@126.com <br>
MSN:chenbo1207@msn.cn <br>
QQ:1013514848<br>
<br>
</p>
</body>
</html>
show一下,俺的水平还可以吧呵呵!!!
顺便说一下,用代码的需要版权的嘿嘿!!!
-------陈波 2011-10-12