开发者

How to create Search Box without using plug-ins?

I'm new to this and doing some research on how to create a Search Box from开发者_开发问答 scratch (without using plug-ins like Google, etc).

The idea is to search within a particular website NOT all websites like Google does. Search results need to be displayed on that particular website.

Preferably using JS and PHP.

Please advise. Thanks.


its pretty simple. from javascript/DOM you need: onkeypress or onkeyup. plus ajax technology to send it while user is on your page ( without redirects. but I think its better to not use ajax in this subject ) from php you need an "handler" script which will get your requests from your search field ( input type=text ) and search data in your DB using simple SELECT (you can use LIKE option). and then you fetch all results form your request to your result page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜