upload file from php in specific folder or mysql [closed]
I need to upload photo at register form, but i dont know how to do that in php. I wanna to store uploaded file in a specific folder or in mysql
The best I can say is please check the PHP Manual on Handling File Uploads.
Start with a form like this:
<form enctype="multipart/form-data" action="yourphp.php" method="POST">
Choose Image: <input name="my_image" type="file" />
<input type="submit" value="Upload" />
</form>
and in PHP, if a file is submitted, you can find details in $_FILES['my_image']
in this case. Be sure to read the manual thoroughly for additional details and security measures.
If you need to store avatars, you can also try Gravatar that is used by StackOverflow as well AFAIK.
精彩评论