Changeset 9008 for trunk/ippMonitor/raw/ipp.php
- Timestamp:
- Sep 27, 2006, 12:30:54 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/raw/ipp.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/raw/ipp.php
r9003 r9008 19 19 // connect to the database 20 20 require_once('DB.php'); 21 $db = DB::connect("mysql://ipp:ipp@localhost/ipp"); 21 # $db = DB::connect("mysql://ipp:ipp@localhost/ipp"); 22 $db = DB::connect("mysql://ipp:ipp@localhost/detrend"); 22 23 if (DB::iserror($db)) { 23 24 echo "<b>error accessing database</b><br>\n"; … … 176 177 } 177 178 179 function check_restrict ($key, $where) { 180 // echo "key: $key<br>\n"; 181 if ($_SERVER[REQUEST_METHOD] == 'GET') { 182 $value = $_GET[$key]; 183 // echo "using GET<br>\n"; 184 } else { 185 $value = $_POST[$key]; 186 // echo "using POST<br>\n"; 187 } 188 // echo "value: $value<br>\n"; 189 if ($value) { 190 if ($where) { 191 $where = $where . " AND $key = '$value'"; 192 // echo "where 1: $where<br>\n"; 193 } else { 194 $where = "$key = '$value'"; 195 // echo "where 2: $where<br>\n"; 196 } 197 } 198 return $where; 199 } 200 201 function write_query_row ($key) { 202 $value = $_POST[$key]; 203 if (($_SERVER[REQUEST_METHOD] == 'POST') && $value) { 204 echo "<td class=\"list\"> <input type=\"text\" name=\"$key\" value=\"$value\"> </td>\n"; 205 } else { 206 echo "<td class=\"list\"> <input type=\"text\" name=\"$key\"> </td>\n"; 207 } 208 } 209 210 // expect image supplied with key=name 211 function insert_image ($key) { 212 213 if ($_SERVER[REQUEST_METHOD] == 'GET') { 214 $name = $_GET[$key]; 215 } else { 216 $name = $_POST[$key]; 217 } 218 219 if ($name) { 220 echo "<img src=\"$name\">\n"; 221 } 222 } 223 178 224 // $myPage = $_SERVER[SCRIPT_NAME] . "?pass=$pass"; 179 225
Note:
See TracChangeset
for help on using the changeset viewer.
