b2c信息网

您现在的位置是:首页 > 热点问题 > 正文

热点问题

php搜索引擎源码(php源码之家)

hacker2022-06-09 15:03:16热点问题89
本文目录一览:1、关于搜索功能那个php代码,能再详细点吗?

本文目录一览:

关于搜索功能那个php代码,能再详细点吗?

数据库(mysql):一个数据库(search),库里面一个表(title),表里面一个字段(name).

PHP页面:两个页面(index.php

search.php)

第一步.创建数据库.(目前大家应该都是用的phpmyadmin来操作数据库的吧?)

建立一个数据库.

第二步.建表

在刚建立的search数据库里插入一个名字为title的表.建表时让选插入几个字段.写1就可以了.

第三步.建字段

插入的字段命名为name,长度值20就可以了.

—–数据库部分已经做完,接下来是网页部分—–

第四步.建立两个页面

建立两个文件:index.php和search.php可以使用记事本等文本工具直接建立.我使用的工具是Dreamweaver(方便嘛.呵呵).

第五步.index.php的页面制作.

这个页面是用来传递你搜索的关键字的.代码如下:

form method=”post”

action=”search.php”

name=”search”

input name=”search” type=”text” value=”"

size=”15″ input type=”submit”

value=”Search”

/form

这段代码是建立一个FORM表单.专门用来提交数据的.

第一行是FORM表单的开始.它的传递方式是post,传递到search.php这个页面.表单名为name.

第二行是文本域和提交按钮.文本域命名为search,按钮默认就可以了.

第三行是FORM表单的结束语句.

第五步.search.php的页面制作.

这个页面很关键.因为他是获取index页面传递过来的值,然后导出搜索的数据.

首先要绑定你建立的search数据库,我用的DW生成的.

上一个页面传送的文本域是search.所以,这里需要建立一个search变量.来接收你输入的关键词.用以下语句定义变量:

?php

$searchs = $_POST['search'];

?

然后建立一个记录集,选择高级.SQL语句中填写:

SELECT *

FROM title

WHERE name like

‘%$searchs%’

这句的意思是选择title表里面的所有字段(*),然后查询name中的$searchs变量。这个变量也就是你在index中输入的值啦。

然后在BODY里面绑定一个动态文本。选择NAME。

我有一份PHP的网站源码,怎么从这个源码中找到后台的登录地址。

不同的php源码可能后台登陆的时候不一样,有可能是admin 或者是dede 或者是其他的,还有一种就是看看robots.txt 这个文件,一般都是不让搜索引擎抓取的!!要不你就从他的系统结构去看了!

php搜索引擎蜘蛛程序

推荐一个国外知名度颇高的搜索引擎,含有网页蜘蛛程序,以前好象有人想要这方面的资料,现在有了,大家可以研究下源码。

官方网站:

演示:

... te=100option=start

中文版本和演示,我以前提供过(1.62版本的汉化),2003年11月换空间的时候没备份,没了。找下载了的人看看有没有。

下载:

这是最近(2003年12月)更新的版本的下载(1.65 En):

演示:

主要功能:

类似google、百度的搜索引擎,php+mysql。

PhpDig is a http spider/search engine written in Php with a MySql database in backend.

HTTP Spidering : PhpDig follows links as it was any web browser within a web server, to build the pages list to index. Links can be in AreaMap, or frames. PhpDig supports relocations. Any syntax of HREF attribute is followed by Phpdig.

PhpDig don't go out the root site you define for the indexing. Spidering depth is choosen by user.

All html content is listed, both static and dynamic pages. PhpDig searches the Mime-Type of the document, or tests existence of an tag at the beginning of it.

支持全文搜索

Full Text indexing : PhpDig indexes all words of a document, excepting small words (less than 3 letters) an common words, those are definded in a text file.

Lone numbers are not inded, but those included in words. Underscores make part of a word.

Occurences of a word in a document is saved. Words in the title can have a more important weight in ranking results.

支持多种格式文件的索引,如pdf

File types wich can be indexed : PhpDig indexes HTML and text files by itself.

PhpDig could index PDF, MS-Word and MS-Excel files if you install external binaries on the spidering machines to this purpose.

To demonstrate the feature, you can search into Hamlet (tragedy, William Shakespeare) in MS-Word format, and L'Avare (comedy, Molière) in Pdf format.

支持robots

Other features : PhpDig Tries to read a robots.txt file at the server root. It searches meta robots tags too.

The Last-Modified header value is stored in the database to avoid redundant indexing. Also the meta revisit-after tag.

可针对特定网站进行全文索引,蜘蛛可1-9个层自动获取全部url

其中的蜘蛛程序写得十分好,有兴趣的朋友推荐研究下。

希望对你有用!

发表评论

评论列表

  • 莣萳绾痞(2022-06-09 20:32:20)回复取消回复

    ed in words. Underscores make part of a word. Occurences of a word in a document i