(图片尚未找到)图片上传到数据库,而网站是在虚拟主机

(The image is not yet found)Image Uploading to Database while The Site is at Web Host

此代码在我的本地主机上 运行。使用 localhost wampserver 将图像上传到我的 mysql 服务器。一切似乎都很好。但是当我将代码迁移到托管站点时,我在mysql服务器中看不到上传的图像。我只能看到我的路径 "images-storage/" 作为 "photo" 列的值,"images-storage" 是空的并且没有存储图像。

这是代码:

我的表格:

<form action="add.php" method="POST" enctype="multipart/form-data">
    Firstname: <input type="text" name="firstname"><br />
    Lastname: <input type="text" name="lastname"><br /><br />
    <input type="file" name="image">
    <input type="submit" value="Submit">
</form>

我的表单操作:

<?php
    include_once('config.php');

    $fn = $_POST['firstname'];
    $ln = $_POST['lastname'];
    $name = $_FILES["image"]["name"];
    $type = $_FILES["image"]["type"];
    $size = $_FILES["image"]["size"];
    $temp = $_FILES["image"]["tmp_name"];
    $error = $_FILES["image"]["error"];

    if($error > 0) {
        echo "Error";
    } else {
        $add_image = move_uploaded_file($temp,"uploaded/".$name);
        $path = 'uploaded/'.$name;
        $query = $mysqli->query("INSERT INTO info(fn,ln,name,photo) VALUES('$fn','$ln','$name','$path')");  
    }

    header('Location: index.php');
?>

只需在数据库中添加 "name" 列。哈哈