?
Path : /home/yogsadhna/public_html/admin/ |
Current File : /home/yogsadhna/public_html/admin/insert.php |
<? ob_start(); include "include/connection.php"; $obj=new db(); if($_POST) { extract($_POST); //$isbn=$_POST['isbn']; //$author=$_POST['author']; $imageName=$ptype."-".$_FILES['image']['name']; $source=$_FILES['image']['tmp_name']; move_uploaded_file($source, "product_images/".$imageName); $imagethum=$ptype."-".$_FILES['imagethum']['name']; $sourcethum=$_FILES['imagethum']['tmp_name']; move_uploaded_file($sourcethum, "produt_thum/".$imagethum); $sql= "insert into product (`productId`, `proName`, `isbn`,`author`,`year`,`publisher`,`pages`,`binding`,`language`,`price`, `proImage`, `proThum`, `proType`, `date`, `hardbound`, `paperback`, `new`, `best`, `forth`, `award`) values ('', '$name', '$isbn','$author','$year','$publisher','$pages','$binding','$language','$price', '$imageName', '$imagethum', '$ptype', now(),'$hardbound', '$paperback', '$new', '$best', '$forth', '$award')"; $obj->query($sql); header("location:addProduct.php?id=".$ptype."&st=success"); }