The image was uploaded successfully. Is there any data in the database?
P粉845382159
P粉845382159 2023-01-12 21:41:10
0
1
836

<?phprequire_once ("../../conn/Conn_DB.php");//Determine required information if($_POST["txt_name"]!="" && $_FILES["txt_image"] !="" && $_POST["txt_vprice"]!=""){ $ptid=$_POST["txt_parentid"]; //Category number $name=$_POST["txt_name"]; //Book name $image =$_FILES["txt_image"]; //Picture $vprice=$_POST["txt_vprice"]; //Member price $mprice=$_POST["txt_mprice"]; //Price $author=$_POST["txt_author" ]; //Author $press=$_POST["txt_press"]; //Publisher $intro=$_POST["txt_intro"]; //Introduction $sellnum=$_POST["txt_sellnum"]; //Sales quantity $ storenum=$_POST["txt_storenum"]; //Inventory quantity $createtime=date('Y-m-d H:i:s'); //Publish time $sql="insert into Product_Info(PT_ID,P_Name,P_Image,P_VPrice,P_MPrice ,P_Author,P_Press,P_Intro,P_SellNum,P_StoreNum,P_Hits,P_CreateTime,P_Status) VALUES ('$ptid','$name','$image','$vprice','$mprice','$author',' $press','$intro','$sellnum','$storenum',1,'$createtime',1)"; $insert=$conn->query($sql); //Determine the execution result if ($insert){ echo"<script>alert('Book added successfully!');window.location='../product_add.php';</script>"; }else{ echo"<script> alert('Book addition failed!');window.location='../product_add.php';</script>"; } //Upload image if($image['size']>0 && $image['size']< 1024*8000){ $dir='../../upload/'; //Set the save directory $name2=$image['name']; //Get the name of the file $rand=rand(0,8000000 ); //Generate a random number between 0 and 8000000 $name2=$rand.date('YmdHis').$name2; //Reassemble the file name $path=$dir.$name2; //Make a complete Save path (directory folder) if(! is_dir($dir)){ //If the directory exists mkdir($dir); //Create the directory } } $i=move_uploaded_file($image['tmp_name'], $path); //Copy the file to implement the upload function if($i==true){ $path=substr($path,6,strlen($path) -6); //Modify the image path }else{                                & lt; script & gt; alert ('file upload failed!'); & lt;/script & gt; "}} else {echo" & lt; script & gt; alert ('file size does not meet the requirements of the website! "ript & gt;" ;

P粉845382159
P粉845382159

reply all(1)
WBOY

I don’t understand what you want to express

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template