您如何允许用户在Web应用程序中动态创建网页? [英] How do you allow users to dynamically create a web page within a web app?
本文介绍了您如何允许用户在Web应用程序中动态创建网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,当用户向问答网站添加问题时,该问题通常会获得自己的网页,并且该网页是即时创建的。如何使用PHP做到这一点?有人可以指出我任何资源吗?谢谢。
For example, when a user adds a question to a Q&A site, that question typically gets its own web page, and that web page was created on-the-fly. How can you do this with PHP? Could anyone point me to any resources? Thanks.
推荐答案
通过该问题通常具有自己的网页,您指的是具有自己的网址。例如,这是如何允许用户在Web应用程序中动态创建网页?。
By "that question typically gets its own web page" you are referring to "gets its own url". For example, this one is How do you allow users to dynamically create a web page within a web app?.
这实际上只是一个把戏。非常简化:
It's really just a trick. Very simplified:
- 提交此问题时,它获得了唯一的标识符3723813,并插入到数据库中。
- 有一个用于处理问题的控制器脚本,例如 https://stackoverflow.com/questions.php
- 当有人尝试打开此页面时,服务器知道使用诸如之类的模块将其发送到
questions.php
href = http://www.workingwith.me.uk/articles/scripting/mod_rewrite rel = nofollow noreferrer>针对Apache的mod_rewrite 。 - 然后,
questions.php
查看url参数,获取此问题的唯一ID 3723813,并加载其信息 - URL的其余部分只是装饰性的,就在那儿,这样我们就可以在打开页面之前立即知道它是什么问题。 >
- When you submitted this question, it got a unique identifier 3723813 and was inserted into a database.
- There is a single controller script that deals with questions, say https://stackoverflow.com/questions.php
- When someone tries to open this page, the server knows to send it to
questions.php
by using a module such as mod_rewrite for apache. - Then,
questions.php
looks at the url parameters, takes the unique id for this question, 3723813, and loads up its information from the database in order to display it. - The rest of the url is just cosmetic and just there so that we can right away know what question it is before opening the page.
这篇关于您如何允许用户在Web应用程序中动态创建网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文