开发者

upload file from php in specific folder or mysql [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be r开发者_如何学Goeasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜