gpt4 book ai didi

php - 如何将多个图像 url 上传到数据库并将文件移动到文件夹

转载 作者:行者123 更新时间:2023-11-28 23:25:53 25 4
gpt4 key购买 nike

<分区>

我想将多个图像 url 上传到数据库,之后我将文件移动到上传文件夹,然后想要显示图像并可能通过更改或删除它们进行编辑。我已经能够用一张做到这一点,但我想对多张照片做到这一点。

这是我的html

<section class="form-group">
<section class="col-md-12">

<label for="price">Add Image</label>

<input type="file" name="uploadedfile" id="uploadedfile" class="form-control" />
<input type="hidden" name="MAX_FILE_SIZE" value="100000">


</section>
</section>

现在我的 php 脚本

  $target_path="uploads/";

$target_path=$target_path.basename($_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {

}

if($target_path==="uploads/"){
$target_path="images/no-thumb.png";
}



$query="insert into properties
(owner,email,contact,title,location,price,description,property_id,property_type,bedrooms,images,gsize,size,status,post_date)
values('$name','$email','$contact',
'$title','$location','$price','$description','$listid',$type','$bedroom','$target_path','$gsize','$size','$status',now())";


$result=mysqli_query($dbc,$query);
if($result){
echo '<p class="bg-success alert alert-success text-center">Property Listing Successful</p>';
}else{
echo '<p class="bg-danger alert alert-danger">My bad!!! Something went totally wrong. Try again later while i try to fix it <span class="close pull-right"> <span class="close pull-right"> <a href="#" >&times; </a></span></p>';
}

```

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com