如何在提交表單後顯示上傳的圖像?提交表單後,它將成爲預覽頁面,所以我不會將圖像類型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