如果您的网站是静态页面(用静态页面的好处不多说了),而你的虚拟主机以支持PHP,那么用PHP 做站内的搜索引擎是个不错的选择!
源代码如下:
<?PHP
/****************************************************
文件名:search.php
源作者:不详
修改者:sunthing.xie/sanxin.xie
调用方法:
<form method="post" action="search.php">
<input type="text" name="key" size=40 value="">
<input type="submit" value="search">
</form>
sunthing 的主页:http://gems.51.net
三新期盼欢迎和大家一起交流
****************************************************/
if (function_exists("set_time_limit") && !get_cfg_var('safe_mode')){
set_time_limit(600);
}
$my_os=$HTTP_ENV_VARS["OS"];
$linux_doc_path=$_SERVER["DOCUMENT_ROOT"];
$my_path_info=$HTTP_ENV_VARS["PATH_INFO"];
$my_path_translated=$HTTP_ENV_VARS["PATH_TRANSLATED"] ;
function get_doc_path(){
global $my_os,$linux_doc_path,$my_path_info,$my_path_translated;
if(substr(strtolower($my_os),0,3)!="win"){