Changeset 12835 for trunk/ippMonitor/raw/ipp.php
- Timestamp:
- Apr 16, 2007, 3:21:41 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/raw/ipp.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/raw/ipp.php
r11490 r12835 28 28 echo "</form>\n"; 29 29 30 $db = dbconnect('ippadmin'); 31 32 // make this a DB lookup 33 $sql = "SELECT projname FROM projects"; 34 35 $qry = $db->query($sql); 36 if (DB::iserror($db)) { 37 echo "<b>error reading project list</b><br>\n"; 38 menu_end(); 39 } 40 41 echo "<table class=select>\n"; 42 echo "<tr class=select><th class=select> projects </th></tr>\n"; 43 while ($qry->fetchInto($row)) { 44 echo "<tr class=select><td class=select> $row[0] </td></tr>\n"; 45 } 46 echo "</table>\n"; 47 30 48 menu_end (); 31 49 } … … 34 52 35 53 // connect to the database 54 // these should be set on installation 36 55 require_once('DB.php'); 37 $db = DB::connect("mysql://ipp:ipp@alala/$database"); 56 $password = "ipp"; 57 $username = "ipp"; 58 $hostname = "alala"; 59 $db = DB::connect("mysql://$username:$password@$hostname/$database"); 38 60 if (DB::iserror($db)) { 39 61 echo "<b>error accessing database</b><br>\n"; 40 echo "<b>tried mysql:// ipp:ipp@localhost/ipp</b><br>\n";62 echo "<b>tried mysql://$username:$password@$hostname/$database</b><br>\n"; 41 63 menu_end(); 42 64 } … … 57 79 $db = dbconnect('ippadmin'); 58 80 59 // make this a DB lookup81 // get the users from the DB 60 82 $sql = "SELECT username FROM users WHERE username = '$username' AND password = '$password'"; 61 83 … … 227 249 } 228 250 229 $this = $_SERVER[SCRIPT_NAME];251 $thisname = $_SERVER[SCRIPT_NAME]; 230 252 $page = "$root/" . $base; 231 if ($page == $this ) {253 if ($page == $thisname) { 232 254 $style = trim($line[1]); 233 255 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
