TAG 0
This commit is contained in:
parent
3ef6faaf8f
commit
0fbd3f2279
18 changed files with 1104 additions and 241 deletions
30
index.php
30
index.php
|
@ -6,6 +6,8 @@
|
|||
* Time: 2:49 AM
|
||||
*/
|
||||
|
||||
include "backend.php";
|
||||
|
||||
function auth(){
|
||||
if(!isset($_SERVER['PHP_AUTH_USER']))
|
||||
return false;
|
||||
|
@ -28,34 +30,14 @@ function get_items(){
|
|||
return $ret;
|
||||
}
|
||||
|
||||
$page = isset($_GET["page"])?$_GET["page"]:"dashboard";
|
||||
|
||||
if (!auth()) {
|
||||
header('WWW-Authenticate: Basic realm="C3CLOC"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
include "templates/404.php";
|
||||
exit;
|
||||
} else {
|
||||
?>
|
||||
<!--p>
|
||||
<?php
|
||||
$mysqli = new mysqli("localhost", "c3cloc", "lrE6AG74aoDBLy.y", "c3cloc");
|
||||
if ($mysqli->connect_errno) {
|
||||
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
|
||||
}
|
||||
echo $mysqli->host_info . "\n";
|
||||
?>
|
||||
</p>
|
||||
<hr>
|
||||
<p>
|
||||
<?php
|
||||
$res = $mysqli->query("SELECT id FROM items ORDER BY id ASC");
|
||||
|
||||
echo "Result set order...\n";
|
||||
while ($row = $res->fetch_assoc()) {
|
||||
echo " id = " . $row['id'] . "\n";
|
||||
}
|
||||
?>
|
||||
</p-->
|
||||
<?php
|
||||
|
||||
include "templates/dashboard.php";
|
||||
include "templates/page.php";
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue