所以我有以下示例:
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
<div id="signupleftpart">
<?php echo $image ?>
<input type="file" name="profilepicture">
<p> <?php echo $image_error ?></p>
</div>
这应该在上载时输出图像,但是我只得到图像的名称,而不是图像本身。
以下是对此负责的代码:
$user_error = $pass_error = $confirmpass_error = $image_error = "";
if (!empty($_POST["profilepicture"])) {
$image = $_POST["profilepicture"];
} else {
$image = '<img src="../../Includes/Pictures/ProfielLogo.png">';
$image_error = "Image upload has been set to default";
}
有什么办法解决这个问题?