doujiazong0322 2015-05-02 14:28
浏览 23
已采纳

创建新页面[关闭]

Suppose we have a form with two field and one submit key. This form will be fill with the "title" and "passage" and then, when we click on submit button, a new page is going to build with "title" and "passage" that we had written them before. How we do this?

You know that what is problem? The problem is "How we can create a new page? Like wikipedia?". Every person can create a page on wikipedia and then write data on it! How? They aren't going to create a file on servers of wikipedia by right cliking!

  • 写回答

2条回答 默认 最新

  • dpowhyh70416 2015-05-02 14:49
    关注

    Pages are basically some data served by a web server (like Apache, nginx or IIS) in response to a request. When you type (http: //wikipedia.org/something/etc) in your browser, the browser locates the server (identified by IP address) associated with that domain, and makes an http request on one of its ports (default port 80 for http, 443 for https) for the specific url you typed. This can be a file on the disk, or some information in the database, or data in the cache of the serving computer, but you need to tell the server how to process the request and what data to return. Otherwise the server will return a 404 status code in response, which means "Not found".

    The browser can also POST data with the request. This is what happens when you submit a form (using HTML form elements). The form will have an attribute called "action" - and this is the link to which the browser will try to submit the data in the form. Again it is up to you to have something set up at the server-end to receive that data, process it by saving it into a database or a new page, and sending back a response page.

    So when you visit Wikipedia, you are not directly doing any of this because Wikipedia's programmers have taken care of all this. Their scripts on the server-side receive the posted data and use it to create new pages or make changes to existing ones.

    This is the very nature of programming: setting something up to take care of certain actions in specific ways, leading to specific results as you wish.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探