国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

PHP制作的仿百度的站內搜索引擎代碼

2024-05-04 23:05:24
字體:
來源:轉載
供稿:網友

以下為引用的內容:

<!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=utf-8" />
<style>
body,td,.p1,.p2,.i{font-family:arial}
body{margin:6px 0 0 0;background-color:#fff;color:#000;}
table{border:0}
a.t:hover{text-decoration:underline}
.f{line-height:100%;font-size:100%;width:43em;padding-left:15px;word-break:break-all;word-wrap:break-word;}
.tit {height:21px; font-size:14px;}
.fb {font-weight:bold;}
.i1 {font-size:16px}
.bi {background-color:#d9e1f7;height:20px;margin-bottom:12px}
.p{padding-left:18px;font-size:14px;word-spacing:4px;}
.m,a.m:link{color:#666666;font-size:100%;}
#ft{clear:both;line-height:20px;background:#e6e6e6;text-align:center}
#ft,#ft *{color:#77c;font-size:12px;font-family:arial}
#ft span{color:#666}
#usrbar{padding-right:10px;line-height:19px;font-size:12px;font-family:arial;text-align:right;white-space:nowrap;margin-bottom:3px !important;margin-bottom:10px;}
.kw {font-family:verdana;font-size:18px;}
.sb {height:2em;width:5.6em;font-size:14px;}
#b {width:600px;height:30px;padding-top:4px;color:#77c;font-size:12px;font-family:arial}
#km {font-size:14px;height:50px;}
#l {font-size:14px;font-family:arial;width:600px;text-align:left;margin-bottom:5px}
img{border:0}
</style>
<title>
<?php
$keyword=htmlspecialchars($_get['keyword']);
if($keyword!="")
{
echo "網頁教學網站內搜索_".$keyword."——powered by VeVb.com";
?> </title>
<?php
}
else
{?>
</title>
</head>
<body>
<br /></br />
<center><a href="/index.html" target="_blank"><img src=http://chinaz.com/program/php/"images/php_logo_search_da.gif" alt="網頁教學網站內搜索" width="189" height="75" border="0" /></a><br />
<br />
<br />
<br />
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="92"></td>
<td height="62"><form action="/search.php" method="get" name="search_form" target="_self" id="f">
<input type="text" name="keyword" class="kw" size="32" maxlength="100"/>
<input type="hidden" name="page" value="1" />
<input name="submit" type="submit" class="sb" value="站內搜索" />
<input type="hidden" name="writekeywords" value="yes" />
<br />
<br />
</form></td>
<td width="100" align="left"><a href="/others/search_help.html" target="_self" style="font-size:12px">幫助</a><br />
</td>
</tr>
</table>
<br />
<p style="height:30px;"><a target=_top href=javascript:window.external.addfavorite('http://www.survivalescaperooms.com','網頁教學網') style="font-size:12px">把網頁教學網加入收藏</a></p>
<p style="height:14px;font-size:12px;"><a href="/others/about_cn.html" target="_blank">關于網頁教學網</a> | <a href="/others/about_en.html" target="_blank" style="font-size:12px">about VeVb.com</a></p>
<p id="b" style="font-size:12px">&copy;2007 VeVb.com <a href="http://www.baidu.com/duty"/></a></a> <a href="http://www.miibeian.gov.cn" target="_blank">冀icp備05002422號</a> <a href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001092500412"><img src="http://gimg.baidu.com/img/gs.gif" /></a></p>
</center></body>
</html>
<?php
exit(0);
}
?>
</head>
<body>
<table width="100%" height="54" align="center" cellpadding="0" cellspacing="0">
<form action="/search.php" method="get" name="search_form" target="_self">
<tr valign="middle">
<td width="100%" valign="top" style="padding-left:8px;width:137px;" nowrap="nowrap"><a href="/index.html"><img src=http://chinaz.com/program/php/"/images/php_log_search.gif" border="0" alt="到網頁教學網首頁" /></a> </td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td width="100%" valign="top"><div class="tit">&nbsp;&nbsp;
</div>
<table cellspacing="0" cellpadding="0">
<tr>
<td valign="top" nowrap="nowrap">
<input name="keyword" type="text" size="39" maxlength="20" value="<?php echo $keyword;?>"/>
<input type="hidden" name="writekeywords" value="yes" />
<input name="submit" type="submit" style="padding-top:2px;" value="搜索本站"/>
<input type="hidden" name="page" value="1" />
&nbsp;&nbsp;&nbsp;</td>
<td valign="middle" nowrap="nowrap"><a href="/others/search_help.html" target="_blank" style="font-size:12px">搜索幫助</a></td>
</tr>
</table></td>
<td></td>
</tr>
</form>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="bi">
<tr>
<td nowrap style="font-size:9pt;line-height:18px;">&nbsp;&nbsp;&nbsp;<a target=_top href=javascript:window.external.addfavorite('http://www.survivalescaperooms.com','網頁教學網')>把網頁教學網設加入收藏</a>.
</a><span style="font-size:12px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 注意:此為本站搜索引擎,并非<a href="http://www.google.cn/" target="_blank">google</a>或者<a href="http://www.baidu.com/" target="_blank">百度</a>數據。</span></td>
<?php
$page=$_get['page'];
$allpage=$_get['allpage'];
$cnt=$_get['cnt'];
$yesno_1=0;
if($_get['writekeywords']=="yes")
{
require("php_admin/admin_conn_1.php");
$query =" select * from nan_keyword where word='".$keyword."'";
require("php_admin/admin_conn_2.php");
while($row = mysql_fetch_array($result))
{
$yesno_1=$row[3];
}
if(!$yesno_1)//if count(*) is null
{
require("php_admin/admin_conn_1.php");
$query="insert into nan_keyword(id,word,num,date) values (null,'".$keyword."',1,'".date("y-m-d",time())."')";
require("php_admin/admin_conn_2.php");
if(!$query)
{
//echo "插入新搜索關鍵詞失??!";
}
else
{
//echo "插入新搜索關鍵詞成功!";
}
$yesno_1=0;
}
else//count(*)is not null
{
$num=$yesno_1+1;
require("php_admin/admin_conn_1.php");
$query ="update nan_keyword set num=".$num.",date='".date("y-m-d",time())."'where word='".$keyword."'";
require("php_admin/admin_conn_2.php");
if(!$query)
{
//echo "更新搜索關鍵詞失?。?quot;;
}
else
{
//echo "更新搜索關鍵詞成功!";
}
}
require("php_admin/admin_conn_1.php");
$query =" select count(*) from nan_article where title like '%".$keyword."%' or about like '%".$keyword."%' or content like '%".$keyword."%'";
require("php_admin/admin_conn_2.php");
if($row = mysql_fetch_array($result))/*取得數據表的所有符合項*/
$cnt=$row[0];
if($cnt!=0)
{
$allpage=ceil($cnt/10);
}
else
{
$allpage=0;
}
}?>
<td align="right" nowrap style="font-size:9pt;line-height:18px;">搜索一下,找到相關網頁<?php echo $cnt; ?>篇&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
<?php
if($allpage==0)
{?>
<div style="margin:0 0 0 15px;font-size:14px;line-height:20px;">
抱歉,沒有找到與“<?php echo $keyword; ?>”相關的網頁。 <br />
<br />
本站建議您:
<div style="margin-top:0px;margin-left:15px;">
<li>看看輸入的文字是否有誤 </li>
<li>去掉可能不必要的字詞,如“的”、“什么”等 </li>
<li>閱讀<a href="/search/noresult.html" target="_blank">幫助</a> </li>
</div>
</div><?php
}
else
{
require("php_admin/admin_conn_1.php");
$query =" select * from nan_article where title like '%".$keyword."%' or about like '%".$keyword."%' or content like '%".$keyword."%' order by id desc limit ".(10*($page-1)).",".(10*$page);
require("php_admin/admin_conn_2.php");
while($row = mysql_fetch_array($result))
{
?>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class=f style="font-size:9pt;line-height:18px;">
<font color=#c60a00></font>
<a href="/html/php<?php echo $row[0];?>.html" target="_self" title="<?php echo $row[2];?>">
<font size="3" color="#261cdc">
<?php
$r11=strip_tags($row[1]);
if(strlen($r11)>69)
{
$sc_t=substr($r11,0,69);
echo $sc_t."...";
}
else
{
echo $r11;
}
?></font></a><br><font size=-1>
<?
$r31=strip_tags($row[3]);
if(strlen($r31)>291)
{
$b=substr($r31,0,291);
echo $b."..."."<br>";
}
else
{
echo $r31."<br>";
}
?></font>
<font color=#008000>
www.survivalescaperooms.com/html/php<?php echo $row[0];?>.html <?php echo $sc_fl=substr($row[6],0,17);?>
</font>
<?php
switch ($row[5])
{
case "新手入門":
?><a href="/newer.html" target="_blank" class="m">新手入門常見問題</a>
<?php break;
case "php基礎":?>
<a href="/base.html" target="_blank" class="m">php基礎</a>
<?php break;
case "php進階":
?><a href="/newer.html" target="_blank" class="m">php進階</a>
<?php break;
case "數據庫":?>
<a href="/base.html" target="_blank" class="m">數據庫操作</a>
<?php break;
case "php源碼":
?><a href="/newer.html" target="_blank" class="m">php源碼</a>
<?php break;
} ?>
</font></td>
</tr>
</table><br>
<?php
}//搜索正文結束
if($allpage!=1)
{?><div class="p"><?php
if($page!=1)
echo"<a href="search.php?page=".($page-1)."&cnt=".$cnt."&allpage=".$allpage."&keyword=".$keyword."" target="_self">上一頁</a>";
for($i=0;$i<$allpage;$i++)
{
if(($i+1)!=$page)
echo " <a href="search.php?page=".($i+1)."&cnt=".$cnt."&allpage=".$allpage."&keyword=".$keyword."" target="_self">[".($i+1)."]</a> ";
else
echo " [".($i+1)."] ";
}
if($allpage!=$page)
echo"<a href="search.php?page=".($page+1)."&cnt=".$cnt."&allpage=".$allpage."&keyword=".$keyword."" target="_self">下一頁</a>";
}?></div>
<?php
}
?>
<table cellpadding="0" cellspacing="0" style="margin-left:18px;height:60px;">
<form action="/search.php" method="get" target="_self"><tr valign="middle">
<td nowrap style="font-size:9pt;line-height:18px;">
<input name="keyword" type="text" size="35" value="<?php echo $keyword;?>"maxlength="20" />
<input type="hidden" name="writekeywords" value="yes" />
<input name="submit" type="submit" style="padding-top:2px;" value="搜索本站"/>
<input type="hidden" name="page" value="1" />
</td></tr>
</form>
</table>
<div id="ft">&copy;2007 網頁教學網 <span>此內容系網頁教學網根據您的指令自動搜索的結果</span></div>
</body>
</html>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 青冈县| 台山市| 通城县| 沂源县| 光山县| 玛曲县| 闽侯县| 濮阳县| 金秀| 老河口市| 贵定县| 绥江县| 青浦区| 枣强县| 宜良县| 东辽县| 博客| 汝城县| 荥阳市| 化州市| 曲阳县| 合江县| 清河县| 定陶县| 濮阳县| 简阳市| 隆子县| 天水市| 哈巴河县| 柳河县| 河池市| 乌拉特后旗| 治县。| 黑龙江省| 金山区| 肇庆市| 龙岩市| 九龙县| 乐陵市| 项城市| 平乡县|