使用 php fopen 创建用户小部件?
场景:我有一个书签小部件,可以在线保存图像。您将图像拖动到书签,该书签将提交到 widget.php。我想创建一个用户系统并为每个用户提供自己的小部件。
我知道(我不是开发人员)我可以使用 fopen 创建新文件,但我正在寻求对此的更深入理解。
我想我想要理解的是,当用户注册时,我需要激活 fopen 来创建 1) 为他们创建的书签和 2) 他们自己的 widget.php 版本?
任何帮助将不胜感激,谢谢。
Scenario: I have a bookmark widget that saves images online. You drag an image to a bookmarklet, which submits to widget.php. I want to create a user system and provide each user with their own widget.
I understand (I'm not a developer) that I can use fopen to create new files, but I'm looking for a deeper understanding of this.
I think what I'm looking to understand is, when a user signs up, I need to activate fopen to create 1) a bookmarklet for them and 2) their own version of widget.php?
Any help would be appreciated, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的问题归结为:如何对服务器端用户系统进行编程,或者更广泛地说,“如何对 php 进行编程”,这不是人们可以在 Stackoverlow 答案中解释的事情。
互联网上有很多学习编程的好资源,而 PHP 是一种广泛传播的编程语言(而且也相当容易上手)。
顺便说一句,如果您正在关注
fopen
,那么您就做错了。您需要在某处存储用户信息(可以选择像 fopen 创建的纯文本文件,但您想要一个数据库),获取正在提交书签的用户(是否已记录?如果没有,请提供登录信息表单),当然还有与用户管理相关的一切:帐户创建、删除、密码恢复、登录和注销......Your question drops down to: how to program a server side user system, or, more broadly, "how to program php", that is not something one can explain in a Stackoverlow answer.
Internet is full of very good resources to learn how to program and PHP is very wide spread programming language (and fairly easy to start with, as well).
If you're looking after
fopen
, by the way, you're doing it wrong. You need to store user information somewhere (a plain text file like the one created by fopen is an option, but you want to have a database), get what user is submitting the bookmark (is it logged already? if not, provide a login form) and of course everything related to user management: account creation, deletion, password recovery, login and logout...