Einzelnen Beitrag anzeigen

CalganX

Registriert seit: 21. Jul 2002
Ort: Bonn
5.403 Beiträge
 
Turbo Delphi für Win32
 
#7
  Alt 15. Dez 2002, 16:28
http://www.chris-harms.de/lexikon/index.php:
Code:
<form action="index.php" method="get">
  <table width="73%" border="0">
  <tr>
    <td width="59%"><font size="-1">Bitte geben Sie einen Suchbegriff ein:</font></td>
    <td width="41%"><input name="keyword" type="text" id="keyword" size="30"></td>
  </tr>
  <tr>
    <td colspan="2"><div align="center">
          <input name="site" type="hidden" id="site" value="lexikon">
          <input type="submit" name="Submit" value="Suchen">
      </div></td>
  </tr>
</table>
</form>
http://www.chris-harms.de/index.php:
Code:
<?php
 $id = $HTTP_GET_VARS["site"];
 $keyword = ( !empty($HTTP_GET_VARS['keyword']) ) ? $HTTP_GET_VARS['keyword'] : "";
 $kid = $HTTP_GET_VARS["kid"];
 $cat = "";
 $lang = "";
 $files = array("disclaimer" => "disclaimer.php",
  "contact" => "contact.php",
  "links" => "links.php",
  "404" => "../errors/404.php",
  "home" => "home.php",
  "rememberit" => "projects/rememberit.php",
  "tools" => "tools.php",
  "internetsurfer" => "projects/internetsurfer.php",
  "codelib" => "projects/codelib.php",
  "counter" => "counter.php",
  "impressum" => "contact.php"
 );
 
 # functions
 function getFileName() {
   
  global $cat;
  global $lang;
  global $files;
  global $id;
 
  if (strpos($id, "tut_") === 0) {  #tutorials
   $rsite = "tutorials.php";
   $lang = substr($id, strpos($id, "_")+1, strlen($id));
#----------------------------------------------
  } elseif (strpos($id, "inf_") === 0) {  # tipps
   $rsite = "info.php";
   $cat = substr($id, strpos($id, "_")+1, strlen($id));  
#----------------------------------------------   
  } elseif ($id == "") {          # others
   $rsite = "home.php";
#----------------------------------------------   
  } elseif ($id == "tipp_tp") {  # tipps
   $lang = "tp";
   $rsite = "tipps.php";
  } elseif ($id == "tipp_delphi") {
   $lang = "delphi";
   $rsite = "tipps.php";
#----------------------------------------------   
  } elseif (($id == "lexikon") && ($keyword == "") && ($kid == "")) {  # encyclopedia
    $rsite = "lexikon/index.php";  
  } elseif (($id == "lexikon") && ($keyword != "") && ($kid == "")) {
    $rsite = "lexikon/search_result.php";
  } elseif (($id == "lexikon") && ($keyword == "") && ($kid != "")) {
    $rsite = "lexikon/show_entry.php";
#----------------------------------------------   
  } else {                   # list
    $rsite = $files[$id];
  }
 
  return $rsite;
 
 }
?>

        <?php
        $s = getFileName();
        if ($s == "")   { $s = "../errors/404.php"; }
        include("sites/".$s);
       ?>
So..

Chris
  Mit Zitat antworten Zitat