如何使用XHTML / HTML将网站搜索功能添加到网站? [英] How to add site search function to website using XHTML/HTML?

查看:77
本文介绍了如何使用XHTML / HTML将网站搜索功能添加到网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的想学习如何为我的网站创建自己的搜索引擎。我有定义的按钮和标签,但它不搜索。我找不出实际搜索网站的HTML或XHTML代码。

I really want to learn how to make my own search engine for my site. I have the defined buttons and labels, but it doesn't search. I can't figure out the HTML or XHTML code for actually searching the site.

这是我到目前为止的代码:

This is the code I have so far:

<p class="search">
    <label>SEARCH</label>
    <input name="search" type="text" class="txt" />
    <input name="search-btn" type="submit" class="btn" value="SEARCH" />
</p>

谢谢!

Thanks!

推荐答案

您不能仅使用HTML和XHTML提供搜索功能,除非您只是使用标准化表单来获取外部搜索引擎(如Google)来完成此项工作。

You cannot provide a search function with just HTML and XHTML, unless you're just using a standardized form to get some external search engine (like Google) to do the work.

可以使用JavaScript进行搜索,但这需要您将所有数据传输到客户端,因此这不是一个好主意。

It is possible to do search with JavaScript, but that requires you to transfer all the data to the client, so it is not a very good idea.

如果你想自己写,你应该使用一些服务器端语言,比如PHP或者Python,这取决于你有什么访问权。

If you want to write it yourself, you should use some server-side language, such as PHP or Python - it depends on what you have access to.

这篇关于如何使用XHTML / HTML将网站搜索功能添加到网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆