如何创建用户帐户?单独的文件夹来保存用户数据——PHP
如何将每个用户的“默认照片”保存到网站上?同一张照片可能会在他们在网站上的一些互动中(可能在聊天会话中)使用,并且可能会显示在他们的个人资料页面上。每个用户都有自己的文件夹吗?如果是这样,我怎样才能创建这样的文件夹。该文件夹会保留在 ftp 上吗?还是MySQL?会占用空间吗?到目前为止,无论上传到服务器上的什么照片,都只是存储在一个名为-'uploadportrait.php'的文件夹中。我能从这里走向何方?如果有人能告诉我这的一般原则,那就太好了!先感谢您。
How would I save each user's 'default photo' onto a website? This same photo may be used during some of their interactions on the site(maybe in a chat session), and it may be displayed on their profile page. Will each user have their own folder? If so, how can I create such a folder. Will this folder stay on ftp? Or MySQL? Will it take any space? As of now, whatever photos are uploaded onto the server, are simply stored in a folder that reads--'uploadportrait.php'. Where can I go from this? If someone can tell me the general principles of this, then that would be great! Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果只是一张照片,那么为每个用户创建一个文件夹就没有多大意义。如果您已经有一个有效的上传例程,只需将上传文件的文件路径存储在用户数据库中即可。那么您不需要复制图像。
If it is just one photo it doesn't make much sense to create a folder for each user. If you already have a working upload routine, simply store the file path of the uploaded file inside of the user database. You don't need to duplicate the image then.