Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add site search function to website using XHTML/HTML? [closed]

Tags:

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!

like image 450
felixd68 Avatar asked Dec 28 '22 14:12

felixd68


1 Answers

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.

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.

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.

like image 150
Michael Madsen Avatar answered Dec 31 '22 14:12

Michael Madsen