Skip to content
Snippets Groups Projects
Commit 6db16575 authored by Bob Mottram's avatar Bob Mottram
Browse files

Integrated search

parent 664bb332
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,13 @@
<a href="about.html"><img id="headerpic" class="img-responsive" src="images/logo.png" alt="Freedombone"></a>
</div>
<center>
<form action="search.php" method="post">
<input type="text" name="search_query">
<input type="submit" name="submitsearch" translate="yes" value="Search">
</form>
</center>
<div class="row">
<div class="column">
<div>
......
<?php
// Run a search query
$output_filename = "index.html";
if (isset($_POST['submitsearch'])) {
$search_query = htmlspecialchars($_POST['search_query']);
$host = $_SERVER['HTTP_HOST'];
header("Location: http://$host/search/?q=".$search_query."&categories=general");
$output_filename = "http://$host/search/?q=".$search_query."&categories=general";
}
$htmlfile = fopen("$output_filename", "r") or die("Unable to open $output_filename");
echo fread($htmlfile,filesize("$output_filename"));
fclose($htmlfile);
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment