Advertisement
Guest User

Untitled

a guest
Oct 11th, 2017
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.59 KB | None | 0 0
  1.  
  2. <html>
  3. <head>
  4. <link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
  5. <link rel="stylesheet" type="text/css" href="../css/style.css">
  6. </head>
  7. <?php
  8.  
  9. $domainame = $_SERVER['SERVER_NAME'];
  10. //======================================================================
  11. //Script time
  12. //======================================================================
  13. $time1 = microtime(true);
  14. error_reporting(E_ALL);  // Turn on all errors, warnings and notices for easier debugging
  15. // Check if the post variable is set:
  16. if (isset($_POST)) {
  17. // Check if the key search post variable is set:
  18.   if (isset($_POST["search"])){
  19.     // Define the query:
  20.     $query = htmlspecialchars($_POST['search']);
  21.   }
  22. }
  23. //======================================================================
  24. // For the HTML  
  25. //======================================================================
  26. //divide string in to array
  27. $allterms=explode(';', $query);
  28. //terms in array count
  29. $termc=sizeof($allterms);
  30. // a bit nicer represenatation of what we're searching
  31. $niceeterms = preg_replace('/;/', '', $allterms);
  32. $niceterms = implode(",",$niceeterms);
  33.  
  34. function searchcall(){
  35.     global $niceterms;
  36.     global $termc;
  37. echo 'Selected terms: '. $niceterms. ".<br>
  38. Found terms: ".$termc.".<br>
  39. "."In 5 seconds starting the search." ;
  40.     }
  41. ?>
  42.  
  43.  
  44. <body>
  45. <header>
  46. <div id="title"><h1>Found terms</h1> </div>
  47. </header>
  48.  
  49. <div id="info"><h4> <?php searchcall();?> </h4>
  50. </div>
  51.  
  52. <script>
  53. setTimeout(function () {
  54.    window.location.href= 'paieska.php'; // the redirect goes here
  55.  
  56. },5000);
  57. </script>
  58.  
  59. </body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement