search.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. if(isset($_POST['pattern'])) {
  3. $pattern = $_POST['pattern'];
  4. }
  5. elseif(isset($_GET['function'])) {
  6. $pattern = $_GET['function'];
  7. }
  8. //$show = $_POST['show'];
  9. $show = strip_tags($_REQUEST['show']);
  10. if(isset($pattern) && ($pattern) && isset($show) && ($show == "manual")) {
  11. $location = "/manual-lookup.php";
  12. $query = "q=".urlencode($pattern);
  13. Header("Location: ".$location."?".$query);
  14. exit;
  15. }
  16. if(isset($pattern) && ($pattern) && isset($show) && ($show == "manual1")) {
  17. /* ALTER FOR LOCAL $location = "manual1-lookup.php"; */
  18. $location = "/manual1-lookup.php";
  19. $query = "function=".urlencode($pattern);
  20. Header("Location: ".$location."?".$query);
  21. exit;
  22. }
  23. if(isset($pattern) && ($pattern) && isset($show) && ($show == "whole-site")) {
  24. $pattern .= ' site:gtk.php.net ';
  25. $query = urlencode($pattern);
  26. $location = 'http://search.yahoo.com/search?ei=UTF-8&p=' . $query;
  27. Header("Location: ".$location);
  28. exit;
  29. }
  30. if(isset($pattern) && ($pattern) && isset($show) && ($show == "wiki")) {
  31. $query = urlencode($pattern);
  32. $location = '/wiki/Main/SearchWiki?text=' . $query;
  33. Header("Location: ".$location);
  34. exit;
  35. }
  36. if (isset($pattern) && ($pattern)) {
  37. $location = "http://marc.theaimsgroup.com/";
  38. if (substr($show, -5) == "-list") {
  39. $list = substr($show, 0, -5);
  40. $query = "l=$list&w=2&r=1&q=b&s=".urlencode($pattern);
  41. Header("Location: ".$location."?".$query);
  42. exit;
  43. }
  44. }
  45. ?>