I am making a Cpanel for a open cart and I have to Upload 3 images of a product like this
<label for="password" class="control-label"><b>Product image:</b></label>
<div class="controls">
<input type="file" name="Upload" id="password" class="span9 required" required />
</div>
<label for="password" class="control-label"><b>Product image:</b></label>
<div class="controls">
<input type="file" name="Upload" id="password" class="span9 required" required />
</div>
<label for="password" class="control-label"><b>Product image:</b></label>
<div class="controls">
<input type="file" name="Upload" id="password" class="span9 required" required />
</div>
I have searched many file upload code but none can make my work easy.
I am working in a Framework so I will send this data to database class: $this->mlogin->dbfunction($POST,$image1,$image2,$image3);
where my insert query will execute
here is the database code
public function product_upload($_POST,$path) {
$this->insert_query="INSERT INTO `_product`(
`_p_name`,
`_p_cat`,
`_p_brand`,
`_p_price`,
`_p_amount`,
`_p_image`,
`_p_dcrp`
)
VALUES(
'" .$_POST['name'] . "',
'" .$_POST['cat'] . "',
'" .$_POST['brand'] . "',
'" .$_POST['price'] . "',
'" .$_POST['avail'] . "',
'" .$path . "',
'" .$_POST['detail'] . "'
)";
return $this->select();
}