إعلانيمكن أن تكون علامتك التجارية هناعلامتك التجارية هنافي كل صفحة من Darslab · طلاب وأولياء أمور ومعلمونinfo@darslab.comاسأل عن الأسعارالأسعارinfo@darslab.com
☰ خطة العام · تكنولوجيا المعلومات والاتصالات (بالإنجليزية)

Free programs, web pages and servers

الأسبوع 1 · الوحدة ١ «أساسيات تصميم موقع الويب» (١): هدف الوحدة، البرامج المجانية ومفتوحة المصدر، صفحات الويب الساكنة والديناميكية، الخوادم والسكريبتات · 3 دروس
2

Static or dynamic? Two kinds of web page

ICT Secondary 2 Term 1, Unit 1: pp. 7–13
GoalExplain the difference between a static and a dynamic web page, and why the address alone cannot always tell you which one you have.
New words
static web page · a file stored on the server and sent exactly as it isdynamic web page · a page built by code on the server when it is asked forfile extension · the letters after the dot in a file name, such as html or phpURL · the address that tells the browser where a page is
Explanation

A static page is a ready-made file, usually ending in .htm or .html. The server finds the file and sends it as it is, so every visitor gets the same page until someone edits the file. It may hold text, pictures, tables and links, and the page itself does no calculating. A dynamic page is different: it contains code that the server runs when the page is requested. The code can read a record from a database or react to what the visitor typed, so the result can change from one visitor to the next, or from one hour to the next. For example, a page that shows “the books you borrowed” must be dynamic, because the list is different for each member. Often the end of the address, such as .php, hints at the kind of page. It is only a hint: some addresses hide the extension, so you cannot always tell. What matters is whether the server builds the page or just sends a file.

Static pageDynamic page
Who makes the page?nobody: the file is readycode on the server, at the request
Same for every visitor?yesno, it can change
Usual file.html or .htm.php
ExampleAbout the clubBooks this member borrowed
Worked examples
PageVisitorWhat arrives
about.htmlMonathe ready file
about.htmlOmarthe same file
my_books.phpMonaa list of 3 books
my_books.phpOmara list of 1 book
The club site has about.html and my_books.php. Mona asks for about.html at 10:00 and Omar at 11:00: both receive the same file. Then each asks for my_books.php. The server code looks up each member in the database, so Mona sees three books and Omar sees one. The first page is static, the second dynamic.
Address ends inWhat can we say?
books.phpprobably dynamic
news.htmlprobably static
page?id=4extension hidden: cannot say
Salma reads three addresses. The first ends in books.php, the second in news.html and the third is www.nile-club.example/page?id=4. The first is probably dynamic and the second probably static. For the third, the address hides the extension, so she cannot say; she must find out how the server makes the page.
Class activity

Invent a small site for a reading club with six pages (for example: home, about, contact, list of books, a member’s loans, a page that shows today’s date). Write for each page whether it can be static or must be dynamic, with one reason.

Practice
1
A page shows the same text to everyone and is stored as club.html. Static or dynamic?
2
Why must a page that shows today’s date be dynamic?
3
Is the ending .php always proof that a page is dynamic? Explain.
4
Name one thing a dynamic page can do that a static page cannot.