如何在PHP中创建页面以上传图片

如何在PHP中创建页面以上传图片

本文介绍了如何在PHP中创建页面以上传图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi pple



hi pple

I have an question, i am creating a webpage for an assignment and one is that I have to create a page for the users to upload their pictures for other to see and take but I would like to know how do i go about doing that in php. can someone point me in the right direction. or at least give me a head start.





我的尝试:





What I have tried:

I have an question, i am creating a webpage for an assignment and one is that I have to create a page for the users to upload their pictures for other to see and take but I would like to know how do i go about doing that in php. can someone point me in the right direction. or at least give me a head start.

推荐答案

<form action="accept-file.php" method="post" enctype="multipart/form-data">
Your Photo: <input type="file" name="image" size="25" />
<input type="submit" name="submit" value="Submit" />
</form>
After you create this HTML form, you’ll now have to write a PHP script in order to process the PHP file upload. Below you’ll find PHP file upload script code for the same.
PHP Script:
//if they DID upload a file...
if(




这篇关于如何在PHP中创建页面以上传图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 08:07