Ehem... PHP > 3... and no register globals
authorJoey Schulze <joey@infodrom.org>
Fri, 28 Sep 2007 07:25:09 +0000 (07:25 +0000)
committerJoey Schulze <joey@infodrom.org>
Fri, 28 Sep 2007 07:25:09 +0000 (07:25 +0000)
src/search.php3

index 4642565..5edd53c 100644 (file)
@@ -1,12 +1,12 @@
 <?
-  if ($keyword && $site) {
-    $url = "http://" . $site . "/search?as_q=" . ereg_replace (" ", "+", $keyword)
+  if (isset($_POST["keyword"]) && isset($_POST["site"])) {
+    $url = "http://" . $_POST["site"] . "/search?as_q=" . ereg_replace (" ", "+", $_POST["keyword"])
           . "&as_sitesearch=infodrom.org";
 
     header ("Location: $url");
-    mail ("joey@luonnotar.infodrom.org", "http://lists.infodrom.org/search.php3",
-"Site    : $site
-Keywords: $keyword
+    mail ("joey@luonnotar.infodrom.org", "http://lists.infodrom.org/search.html",
+"Site    : $_POST["site"]
+Keywords: $_POST["keyword"]
 Host    : " . ($REMOTE_HOST?$REMOTE_HOST:$REMOTE_ADDR) . "
 URL     : " . $url . "\n", "From: Infodrom Webserver <www-data@luonnotar.infodrom.org>");
   } else {