This is the Part 2 of “How To Create A Search Engine In PHP”. In this part, We’ll add code to files that are being displayed to the users. We make the database and the table in this part.
index.php
The main page of our Web Search is index.php. It has a simple design and is not very advanced as Yahoo or something else.
<?include("inc/functions.php");?>
<html>
<head>
<?head("", array("index"));?>
</head>
<body>
<?headerElem();?>
<div class="container">
<center>
<h1>Web Search</h1>
<form class="searchForm" action="search.php" method="GET">
<input type="text" autocomplete="off" name="q" id="query"/>
<div>
<button>
<svg class='shape-search' viewBox="0 0 100 100" class='shape-search'><use xlink:href='#shape-search'></use></svg>
</button>
</div>
<p>Free, Open Source & Anonymous</p>
</form>
</center>
</div>
<?footer();?>
</body>
</html>
We use simple functions for every files. head() function accepts two parameters. The first parameter is the title of the web page. The main site title will automatically be appended to the title you give in the first parameter when it’s displayed as .
...
[READ MORE]