D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
G:
/
PleskVhosts
/
jhalakdembla.com
/
akkonlineservices.com
/
Admin
/
Coding
/
Filename :
ControllerProduct.php
back
Copy
<?php require('db.php'); if(isset($_POST['submit'])){ $CategoryId = $_POST['ctg']; $Title = $_POST['Prdtitle']; $mrp = $_POST['mrp']; $price = $_POST['price']; //------------img---1------------- $file_name1 = $_FILES['imgone']['name']; $file_tmp1 = $_FILES['imgone']['tmp_name']; //------------img---2------------- $file_name2 = $_FILES['imgtwo']['name']; $file_tmp2 = $_FILES['imgtwo']['tmp_name']; //------------img---3------------- $file_name3 = $_FILES['imgthree']['name']; $file_tmp3 = $_FILES['imgthree']['tmp_name']; //------------img---4------------- $file_name4 = $_FILES['imgfour']['name']; $file_tmp4 = $_FILES['imgfour']['tmp_name']; $description = $_POST['description']; if($ProductCtgId != "0"){ $InsertData = "INSERT INTO product (ProductCtgId,Title,Mrp,Price,Image1,Image2,Image3,Image4,Description) VALUES ('$CategoryId','$Title','$mrp','$price','$file_name1','$file_name2','$file_name3','$file_name4','$description')"; } else{ $InsertData = "INSERT INTO product (ProductCtgId,Title,Mrp,Price,Image1,Image2,Image3,Image4,Description) VALUES ('0','$Title','$mrp','$price','$file_name1','$file_name2','$file_name3','$file_name4','$description')"; } $res = mysqli_query($conn,$InsertData) or mysqli_error($conn); // Add the image to the "image" folder" if($res) { move_uploaded_file($file_tmp1,"../img/Productimg/".$file_name1); move_uploaded_file($file_tmp2,"../img/Productimg/".$file_name2); move_uploaded_file($file_tmp3,"../img/Productimg/".$file_name3); move_uploaded_file($file_tmp4,"../img/Productimg/".$file_name4); // header('Location: ../AdminPanel/allblog.php'); header('Location: ../AllProduct.php'); }else{ // header('Location: ../AdminPanel/allblog.php'); header('Location: ../AddProduct.php'); } } ?>