IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 27, 2006, 12:30:54 PM (20 years ago)
Author:
eugene
Message:

adding inline images, php, html, more restricts, * fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/ipp.php

    r9003 r9008  
    1919  // connect to the database
    2020  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");
    2223  if (DB::iserror($db)) {
    2324    echo "<b>error accessing database</b><br>\n";
     
    176177}
    177178
     179function 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
     201function 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
     211function 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
    178224// $myPage = $_SERVER[SCRIPT_NAME] . "?pass=$pass";
    179225
Note: See TracChangeset for help on using the changeset viewer.