Example #1
0
<?php

include "include/include_pre.php";
requireSignin(false);
// requireLevel(100);
// $conn = connect_db($db_server, $db_username, $db_password, $db_dbname);
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <?php 
include 'include/include_head.php';
?>

    <title><?php 
echo $s_title;
?>
</title>

  </head>
  <body>
    <?php 
include "include/include_body.php";
?>
    <div class="container">
      <h1>Hello, world!</h1>
    </div>

    <!--  nev bar -->
    <?php 
include "nev_bar.php";
<?php

include "include/include_pre.php";
requireSignin(TRUE);
requireLevel(0);
$conn = connect_db($db_server, $db_username, $db_password, $db_dbname);
// define variables and set to empty values
$inputId = "";
if ($_SERVER["REQUEST_METHOD"] == "GET") {
    $inputId = testInput($_GET["id"]);
}
// die();
$sql = "DELETE FROM users\n          WHERE id={$inputId};";
// echo $sql;
if ($conn->query($sql) === TRUE) {
    header("Location: admin_users_view.php?success=true&command=delete");
    die;
} else {
    // echo "Error: " . $sql . "<br>" . $conn->error;
    if (strrpos($conn->error, "Duplicate") !== false) {
        echo "Duplicate";
    } else {
        echo $conn->error;
    }
}
<?php

include "include/include_pre.php";
requireSignin(true);
requireLevel(0);
$conn = connect_db($db_server, $db_username, $db_password, $db_dbname);
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <?php 
include 'include/include_head.php';
?>

    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="css/jasny-bootstrap.min.css">

    <!-- Latest compiled and minified JavaScript -->
    <script src="js/jasny-bootstrap.min.js"></script>

    <title><?php 
echo $s_product_dashboard;
?>
</title>

    <style>
      .img_container {
        position: relative;
        display: inline-block;
        text-align: center;
        /*border: 1px solid red;*/