passage aux variabls superglobales
authorJeremy Laine <jeremy.laine@m4x.org>
Sat, 25 Jan 2003 22:43:43 +0000 (22:43 +0000)
committerJeremy Laine <jeremy.laine@m4x.org>
Sat, 25 Jan 2003 22:43:43 +0000 (22:43 +0000)
depview/file.php
depview/list.php

index dc221d7..02e6a76 100644 (file)
@@ -1,12 +1,21 @@
 <?php
 require("config.inc.php");
 require("header.inc.php");
+
+/* validate parameters */
+if (!isset($_REQUEST['id'])) {
+  echo "no file specified";
+  include("footer.inc.php");
+  exit;
+}
+$id = $_REQUEST['id'];
 $res = mysql_query("select path from file where id=$id");
 if (!list($page)=mysql_fetch_row($res)) {
   echo "file $id not found";
   include("footer.inc.php");
   exit;
 }
+$d = isset($_REQUEST['d']) ? $_REQUEST['d'] : 0;
 ?>
 
 <h1>Dependencies for <?php echo $page; ?></h1>
index fc02312..38106b0 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 require("config.inc.php");
 require("header.inc.php");
+
+$order = isset($_REQUEST['order']) ? $_REQUEST['order'] : "p";
 switch ($order) {
   case "i":
     $sql_suffix = "order by id";
@@ -9,7 +11,6 @@ switch ($order) {
     $sql_suffix = "order by type";
     break;
   case "p":
-  default:
     $sql_suffix = "order by path";
     break;
 }
@@ -17,9 +18,9 @@ switch ($order) {
 
 <table>
 <tr>
-  <th><a href="<?php echo $PHP_SELF; ?>?order=i">id</a></th>
-  <th><a href="<?php echo $PHP_SELF; ?>?order=t">type</a></th>
-  <th><a href="<?php echo $PHP_SELF; ?>?order=p">path</a></th>
+  <th><a href="<?php echo $_SERVER['PHP_SELF']; ?>?order=i">id</a></th>
+  <th><a href="<?php echo $_SERVER['PHP_SELF']; ?>?order=t">type</a></th>
+  <th><a href="<?php echo $_SERVER['PHP_SELF']; ?>?order=p">path</a></th>
 </tr>
 
 <?php