$catArray[$x] = $row['category'];
        //Retrives category details
        $query4 = mysql_query("SELECT * FROM `category` WHERE `categoryno` = '{$catArray[$x]}'");
        while ($row1 = mysql_fetch_array($query4)) {
            $path[$x] = $row1['path'];
        }
        // while
    }
    // while
}
// for
// Calls printpic function
printpic($name, $path, $catArray, $picnoarray);
if ($decoy == 0) {
    // Calls insertdb function
    insertdb($name, $path, $picnoarray);
}
// Inserts decoy images.
function insertdb($name, $path, $picnoarray)
{
    $username = $_SESSION['username'];
    $type = $_SESSION['type'];
    for ($r = 0; $r < 16; $r++) {
        $path1 = $path[$r] . "/" . $name[$r];
        $picno = $picnoarray[$r];
        $query = mysql_query("INSERT INTO `decoy` (`username`, `picno`, `type`) VALUES ('{$username}', '{$picno}', {$type})");
    }
}
// Searches the picture category of the image.
function search($picno)
{
Example #2
0
}
if (isset($_POST['brand_add'])) {
    $range_brand = $_POST['range_brand'];
    connect_mysql();
    $sql = "INSERT INTO `brand_range`(`pbrand`) VALUES('{$range_brand}')";
    insertdb($sql);
    echo "<font style='color:red;'>add product brand ok!</font>";
}
if (isset($_POST['product_add'])) {
    $prange = $_POST['prange'];
    $pname = $_POST['pname'];
    $pprice = $_POST['pprice'];
    $pdetail = $_POST['pdetail'];
    connect_mysql();
    $sql = "INSERT INTO `q5_products`(`pname`, `pdetail`, `pprice`, `prangeid`, `addtime`) VALUES('{$pname}','{$pdetail}','{$pprice}','{$prange}',now())";
    insertdb($sql);
    echo "<font style='color:red;'>add product info ok!</font>";
}
?>
	<!DOCTYPE html>
	<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title></title>
		<link rel="stylesheet" href="">
	</head>
	<body>
		<div style="margin:40px auto; width:600px;border: 0px solid #000;">
		
		<form action="admin.php" method="post">