How to make the search engine

How to make the search engine

Search engine – a universal source of information on any subject. It is difficult to find the modern person who never used searchers for search of any data for own interests or for working process. You can not only use ready search engines, but also create own searcher who will function not worse than other modern sites.

The sponsor of placement P&G Articles on the subject "How to Make the Search Engine" How to close the site How to buy on eBay How to check the site on Bang



Define structure of future searcher – in it there have to be three main speak rapidly: the interface written for PHP, an index (MySQL database), and also itself search the robot which is written on Delphi.


Begin development of the searcher with creation of the interface. For this purpose create on the computer the index.php file – the page in the form of the table divided into two parts. In one part of the table the search form, and in the second part – search results will settle down.


In the top part of the page place a text field, the button for sending inquiry and the button for cleaning of a text field. Call buttons – for example, to the button of search set the name "Look for", and to a text field set the name "Search".


Create the PHP code, having begun with a tag


Enter into a code some lines on which the algorithm of search depends: if (isset ($ _GET ['button'])) – if the button of search is pressed; if the button of search is not pressed, add at the end of the line of the else code. In case the button was pressed, the code checking existence of a search query has to work: if (isset ($ _GET ['search'])) { $search= $ _GET ['search']; }


In case search the inquiry is found, its text option has to be appropriated to $search code variable. The line of search has to contain more than three symbols – respectively, in a code there has to be the next line with the necessary parameters defining empty search inquiry: if ($search! =''> 2) { a code of search in a database } else { echo "Is set by && strlen ($search) an empty search query or a line of search contains less than 3 symbols."; }


When the code is ready, start a cycle and remove search results through printf.