Esempio n. 1
0
File: view.php Progetto: cabloo/RTG2
        $e = oci_error();
        die($e['message']);
    }
} else {
    $dbc = mysql_connect($host, $user, $pass) or $dbc = mysql_connect("{$host}:/var/lib/mysql/mysql.sock", $user, $pass) or die(locale(MYSQL_CONNECT_FAIL));
    mysql_select_db($db, $dbc);
}
$path_array = split("/", $_SERVER["PATH_INFO"]);
$update_last = 0;
if ($path_array[1] == "host") {
    print_headers($VERSION, $_SERVER["REQUEST_URI"], $refresh, $path_array[2]);
    if ($path_array[2]) {
        displayhost($dbc, $path_array[2]);
        $update_last = 1;
    } else {
        listhosts($dbc);
    }
} elseif ($path_array[1] == "stat") {
    print_headers($VERSION, $_SERVER["REQUEST_URI"], $refresh, "{$path_array['3']}:{$path_array['2']}:{$path_array['4']}");
    if ($path_array[2] && $path_array[3] && $path_array[4]) {
        displaystats($dbc, $path_array[2], $path_array[3], $path_array[4]);
        $update_last = 1;
    } elseif ($path_array[2] && $path_array[3]) {
        displayclass($dbc, $path_array[2], $path_array[3]);
        $update_last = 1;
    } elseif ($path_array[2]) {
        stathosts($dbc, $path_array[2]);
        $update_last = 1;
    } else {
        liststats($dbc);
    }
Esempio n. 2
0
    <h2> Get value of key:</h2>
    <form method="POST" action="?act=data_get&<?php 
echo $addon;
?>
">
<p>    choose host to connect:<?php 
echo listhosts($data["hosts"]);
?>
</p>
       key: <input type="text" name="key" value="testkey">
        <input type="submit" name="submit" value="submit">
    </form>
</div>
<p></p>
<div id="name" class="codediv">
<h2>Set value </h2>
     <form action="?act=data_set&<?php 
echo $addon;
?>
" method="POST" accept-charset="utf-8">
<p>    choose host to connect:<?php 
echo listhosts($data["hosts"]);
?>
</p>
<p> key:<input type="text" name="key" value=""></p>
<p> expire:<input type="text" name="expire" value="3600">(seconds)</p>
<p> value:<textarea name="value" rows="8" cols="40"></textarea></p>
     <p><input type="submit" value="Continue &rarr;"></p>
     </form>
</div>