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条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!