D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
.trash
/
admin
/
Filename :
pro_add.php
back
Copy
<?php echo "ddd"; die; if(isset($_POST['add'])){ $category =$_POST['addcategory']; $title =$_POST['title']; $price = $_POST['price']; $desc =$_POST['desc']; $imgtitle =$_POST['imgtitle']; $imgalt =$_POST['imgalt']; $rimg1_alt =$_POST['rimg1alt']; $rimg2_alt =$_POST['rimg2alt']; $rimg3_alt =$_POST['rimg3alt']; $rimage1_title =$_POST['rimage1_title']; $rimage2_title =$_POST['rimage2_title']; $rimage3_title =$_POST['rimage3_title']; $seosyntax = $_POST['syntax']; $meta_title = $_POST['metatitle']; $meta_desc = $_POST['metadesc']; $meta_key = $_POST['metakey']; $image01 = $_FILES['image']['name']; if(!empty($image01)){ $unique = uniqid()." ".$image01; $image1 = "images/product/".$unique; $stmp_name1 = $_FILES['image']['tmp_name']; move_uploaded_file($stmp_name1, $image1); }else{ $image1=""; } $image02 = $_FILES['rimage1']['name']; if(!empty($image02)){ $unique2 = uniqid()." ".$image02; $image2 = "images/product/".$unique2; $stmp_name2 = $_FILES['rimage1']['tmp_name']; move_uploaded_file($stmp_name2, $image2); }else{ $image2=""; } $image03 = $_FILES['rimage2']['name']; if(!empty($image03)){ $unique3 = uniqid()." ".$image03; $image3 = "images/product/".$unique3; $stmp_name3 = $_FILES['rimage2']['tmp_name']; move_uploaded_file($stmp_name3, $image3); }else{ $image3=""; } $uniqe_image4 = $fetch['rimage3']; $image04 = $_FILES['rimage3']['name']; if(!empty($image04)){ $unique4 = uniqid()." ".$image04; $image4 = "images/product/".$unique4; $stmp_name4 = $_FILES['rimage3']['tmp_name']; move_uploaded_file($stmp_name4, $image4); }else{ $image4=""; } // $canonicalurl = $_POST['canonicalurl']; $modifiedText0 = str_replace("&", "and", $title); $text = strtolower($modifiedText0); $desc = $_POST['desc']; $replaceArray1 = array( '"' => """, "'" => "'", ); $modifiedText1 = str_replace(array_keys($replaceArray1), array_values($replaceArray1), $desc); $slug = $_POST['slug']; $replaceArray2 = array( ' ' => "-", ); $modifiedText2 = str_replace(array_keys($replaceArray2), array_values($replaceArray2), $slug); $ans =$_POST['answer']; $que =$_POST['question']; $data= mysqli_query($conn,"insert into product (id,category,title,description,price,image,imgalt,imgtitle,rimage1,rimage2,rimage3,meta_title,meta_desc,meta_key,slug,seo_syntax,rimage1_alt,rimage2_alt,rimage3_alt,rimage1_title,rimage2_title,rimage3_title) values(' ','$category','$text','$modifiedText1','$price','$image1','$imgalt','$imgtitle','$image2','$image3','$image4','$meta_title','$meta_desc','$meta_key','$modifiedText2','$seosyntax','$rimg1_alt','$rimg2_alt','$rimg3_alt','$rimage1_title','$rimage2_title','$rimage3_title')"); if($data){ $lastid = $conn->insert_id; for($i=0; sizeof($que)>$i; $i++){ mysqli_query($conn,"insert into product_faq (product_id,question,answer) values($lastid,'".$que[$i]."','".$ans[$i]."')"); } echo "<script> alert('Product Added');window.location.href='products.php'</script>"; } else{ echo "<script> alert('Please try again')</script>"; } } ?>