php图片怎么上传数据 php上传图片到指定文件夹( 五 )


html
head
meta http-equiv="content-type" content="text/html; charset=utf-8"
title upload image to db demo /title
/head
body
form name="form1" method="post" action="upload_image_todb.php" enctype="multipart/form-data"
p图片:input type="file" name="photo"/p
pinput type="hidden" name="action" value="https://www.04ip.com/post/add"input type="submit" name="b1" value="https://www.04ip.com/post/提交"/p
/form
?php
$sqlstr = "select * from photo order by id desc";
$query = mysql_query($sqlstr) or die(mysql_error());
$result = array();
while($thread=mysql_fetch_assoc($query)){
$result[] = $thread;
}
foreach($result as $val){
echo 'pimg
src="/images/defaultpic.gif"
width="150"/p';
}
?
/body
/html
?php
}
?
程序运行截图和数据库截图:
关于php图片怎么上传数据和php上传图片到指定文件夹的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

推荐阅读