看到网站《百度google一下》很好玩,特地花点时间用PHP重写了代码

看到网站《百度google一下》很好玩,特地花点时间用PHP重写了代码

首先,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>&nbsp;&nbsp;<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>
&nbsp;Email:chenbo1207@126.com <br>
&nbsp;MSN:chenbo1207@msn.cn <br>
&nbsp;QQ:1013514848<br>
 <br>
</p>
</body>
</html>
show一下,俺的水平还可以吧呵呵!!!

顺便说一下,用代码的需要版权的嘿嘿!!!

                                                                                                            -------陈波 2011-10-12

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值