Skip to content

平成25年度 春期 ITパスポート試験 問77

This question's explanation and your answers so far.

問77
頻出度★★★

Web ページの来訪者数カウンタなどのように, 訪問者が訪れるごとに新たなページを生成する機能を実現できる仕組みはどれか。

出典 平成25年度 春期 ITパスポート試験 問77
解説

問 77

  • ア

    正解 The correct answer is ア, “CGI”. CGI (Common Gateway Interface) is a convention (an interface specification) by which a web server calls and runs an external program and returns the result to the browser as a web page. An ordinary static web page is just an HTML file stored on the server that is sent back as it is, so its content is the same no matter who views it or when. With CGI, by contrast, the server that receives a request from a browser can start a program according to that request and return the HTML that the program produces. It can therefore generate a page whose content differs on every access, that is, a dynamic page. The visitor counter in the question is a typical example: each time a visitor arrives, a program on the server increases the counter value by one and saves it, then assembles and returns HTML with that latest number embedded in it. Other functions whose results change per user and per access, such as a message board, accepting questionnaire responses, displaying search results, and processing what has been entered in a form, can also be implemented with this mechanism. The only thing that fits the wording of the question, “generates a new page each time a visitor arrives”, is CGI.

  • Incorrectイ

    A cookie is a mechanism in which a web server has the browser store a small piece of data temporarily and has the browser send that data back automatically at the next access to the same site. It is used to keep a login state, to remember the contents of a shopping cart, and to identify users, so it does help in telling “who has come”. However, a cookie itself is no more than a small piece of data placed on the browser side plus the rules for passing it back and forth, and it has no function of running a program on the server and assembling a page. To generate a new page as a visitor counter does, a separate mechanism that carries out processing on the server side is needed after all, and a cookie does not play that role.

  • Incorrectウ

    HTML (HyperText Markup Language) is a markup language for describing, with tags, the structure and content of a web page such as headings, paragraphs, tables, images, and links. It is only a notation that decides “how a page is written out”, not an execution mechanism that branches processing by condition or performs calculations. The content of an HTML file is fixed exactly as it was written in advance, so however many visitors come, the content returned is the same, and it cannot count the number of visitors and reflect that count. The result that CGI generates is returned in the form of HTML, but the machinery that generates it is not HTML itself.

  • Incorrectエ

    SQL (Structured Query Language) is a language for instructing a relational database to search for, add, update, and delete data. It can be used for such purposes as recording a counter value in a database, but SQL is a language that operates a database; it is not the whole set of workings in which a web server receives a request from a browser, starts a program, and returns the result as a web page. What executes SQL is, after all, the program running on the server side (a program started by something such as CGI). Therefore it does not fit as the mechanism itself that generates a new page on every visit.

ここがポイント
  • CGI (Common Gateway Interface) is a convention by which a web server starts an external program and returns the result of running it as HTML, and it is the representative mechanism for realizing dynamic web pages whose content changes on every access. Access counters, message boards, accepting questionnaires and forms, and displaying search results are examples of it.
  • Grasp the difference between a static page and a dynamic page. A static page is one where an HTML file prepared in advance is returned as it is; a dynamic page is one where, after a request is received, a program is run on the server side and a page is built on the spot and returned. It is also good to sort out how similar terms differ in role: HTML is in charge of describing the page, cookie of keeping state and identifying the user on the browser side, and SQL of operating the database, and none of them is the mechanism that generates the page itself.
用語

Your answers