0
<?php
    require_once '../index.php';
    $sku = $_POST['sku'];
    $name = $_POST['name'];
    $price = $_POST['price'];
    $size = $_POST['size'];
    $height = $_POST['height'];
    $width = $_POST['width'];
    $length = $_POST['length'];
    $weight = $_POST['weight'];

    $result = mysqli_query($connect, "INSERT INTO `products` (`sku`, `name`, `price`) VALUES ('$sku', '$name', '$price')");

    header('Location: ../bd.php');
?>
<form action="vendor/create.php" method="post">
    <form id="product_form">
            <div class="SKU">
                <p class="ssku"><b>Sku</b></p>
                <input type="text" name="sku" class="sku" size="30">
            </div>
            <div class="Name">
                <p class="nname"><b>Name</b></p>
                <input type="text" name="name" class="name" size="30">
            </div>
            <div class="PRICE">
                <p class="pprice"><b>Price ($)</b></p>
                <input type="number" name="price" class="price" size="10">
            </div>

    </form>
    <form id="product_type">
        <p class="pprice"><b>Type Switcher:</b></p>
           <style>
            #id1,#id2,#id3{display:none}   
            </style>
           <select name="items" class="type" onchange="showBlock(this.value)">
            <option value="0">Product type</div>
            <option value="1">DWD
            <option value="2">Furniture
            <option value="3">Book
        </select>
        <div id="id1">
            <p>Size (MB)</p>
            <input type="text" name="size" class="size" size="30">
            <p><b>Please, provide disc space in MB</b></p>
        </div>
        <div id="id2">
            <p>Height (CM)</p>
            <input type="text"name="height" class="height" size="30">
            <p>Width (CM)</p>
            <input type="text"name="width" class="width" size="30">
            <p>Length (CM)</p>
            <input type="text"name="length" class="length" size="30">
            <p><b>Please, provide size in CM</b></p>
        </div>
        <div id="id3">
            <p>Weight (KG)</p>
            <input type="text" name="weight" class="weight" size="30">
            <p><b>Please, provide weight in KG</b></p>
        </div>
    </form>
andreymal
  • 13,178

0 Answers0