AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Communication Technology

HTML, PHP, publishing and the session

Week 2 · Unit 1 Basics of Web Site Design (2): HTML, PHP and the web server program, publishing (localhost or hosting), SQL and the database system, web-server packages, the session · 3 lessons
2

Localhost or the internet: where a site lives

ICT Secondary 2 Term 1, Unit 1, Topic 1: pp. 14–19
GoalCompare testing a site on localhost with publishing it on a hosting service, and choose the right one for a situation.
New words
localhost · an address that always means this same computer, used to test before publishinghosting · keeping the site files on a web server of a hosting company so that visitors can reach thempublishing a site · making the site available to visitorsURL · the address that tells the browser where to find a page
Explanation

When you build a site, you test each page before anyone else sees it. The first way to publish is local: your own computer runs a web server program, and you open the page at an address that starts with localhost. The word localhost always means “this same computer”, so a visitor typing it reaches his own machine, not yours. Other computers can reach yours only through its own network address, and only while it is switched on, so localhost is meant for testing. The second way is hosting. A hosting company keeps your files on its web server, which is always on, and visitors anywhere reach the site through its URL, the Uniform Resource Locator, for example www.nile-club.example. Some hosts are paid and some are free. This term’s project stays on localhost; to go public you would upload the finished files to a host, with a teacher’s help.

localhosthosting
Who can see the site?only this computer (testing)any visitor with the URL
Is it always on?only while the computer runsyes, a host keeps it on
Costnonepaid or free hosts
Usebuild and testpublish for the public
Worked examples
Hana tests a new page on her computer at http://localhost/dictionary/index.php. Her classmate Youssef types the same address on his own computer, but he sees his own machine, not Hana’s. Later, with her teacher, Hana uploads the finished files to a host, and everyone can open www.nile-club.example.
SituationBest choiceWhy
(a) page still being writtenlocalhostonly you need it
(b) news for the whole schoolhostingalways on, open to everyone
(c) practice projectlocalhostno cost, nobody else needs it
Which choice fits? (a) Tonight you try a new page you are still writing. (b) The whole school must read the club news every day. (c) You build a practice site for a school project and nobody else needs it.
Class activity

Write the plan for the club site on two lines: where you will test it, and where you would publish it. Give one reason for each choice and say what the visitor types to open it.

Practice
1
What does the word localhost always mean?
2
Can a friend on another computer see your localhost page by typing localhost? Explain.
3
Name two differences between localhost and hosting.
4
What do the letters URL stand for?