diff --git a/webadmin/EN/index.html b/webadmin/EN/index.html index caff742468c3acd095f492c84bae163ac93af51f..888648782744b57025d82750f64abe81c2a6afd0 100644 --- a/webadmin/EN/index.html +++ b/webadmin/EN/index.html @@ -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> diff --git a/webadmin/search.php b/webadmin/search.php new file mode 100755 index 0000000000000000000000000000000000000000..9f4d0aa0ff3f6bf335a5af69a8f3e45cd2bc8359 --- /dev/null +++ b/webadmin/search.php @@ -0,0 +1,21 @@ +<?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); + +?>