如何在提交表单后显示上传的图像?提交表单后,它将成为预览页面,所以我不会将图像类型BLOB存储在MySQLyet中。我如何显示$ _FILES ['image']?
<?php
if(isset($_POST['submit'])) {
//preview page
$info = getimagesize($_FILES['image']['tmp_name']);
$imagetype = $info['mime'];
$tmpname = $_FILES['image']['tmp_name'];
$fp = fopen($tmpname,'r');
$data = fread($fp,filesize($tmpname));
$data = addslashes($data);
fclose($fp);
} else {
?>
<form enctype="multipart/form-data" action="http://www.example.com/submit" method="POST">
<input type="file" name="image" value="" size="50" />
<input type="submit" name="submit" value="submit" />
</form>
<?php
}
?>
Blob在数据库中? [为什么你讨厌小猫?](http://stackoverflow.com/questions/3401761/remote-image-file-to-sqlite-blob-in-php/3401861#3401861) – NullUserException