الأسبوع 4 · الوحدة ٢ «متطلبات ومراحل إنتاج المشروع» (١) مرحلة تصميم صفحات الموقع: مراحل المشروع الثلاث، مخطط صفحات الموقع، وظيفة كل صفحة، صفحتا الترويسة والاتصال تُكتبان مرة وتُضمَّنان · 3 دروس
2
Eight files, eight jobs
ICT Secondary 2 Term 1, Unit 2, Topic 1: pp. 29–39
GoalName the eight files of the site and the job of each.
New words
connection page · a page the visitor never sees, which opens the connection to the databaseheader page · a page holding the banner and the links, shown at the top of every pagehelp page · a page about the site and how to use itcase-sensitive · treating capital and small letters as different letters
Explanation
The site has exactly eight files, and each has one job. index.php is the start page with the links. connection.php opens the connection to the database; the visitor never sees it. header.php holds the banner and the six links (Main, Add, Search, Edit, Delete, Help) and appears at the top of every page. add_term.php adds a term, search_term.php finds one, edit_term.php changes one, del_term.php deletes one, and help.php explains the site and how to use it. A help page of a real site often says who made it and how to contact them; for the club, use an invented address. One more point: write file names in lowercase with underscores, and always use the same spelling. Some servers are case-sensitive, so a link to Add_Term.php will not find a file named add_term.php.
File
Job
Seen by the visitor?
index.php
start page with the links
yes
connection.php
opens the database connection
no
header.php
banner and six links, on every page
yes, as part of each page
add_term.php
add a term
yes
search_term.php
search for a term
yes
edit_term.php
change a term
yes
del_term.php
delete a term
yes
help.php
about the site and how to use it
yes
Worked examples
Group
Files
How many
start page
index.php
1
helper files
connection.php, header.php
2
task pages
add, search, edit, delete, help
5
all together
8
Mona counts the files in the table and gets eight: one start page, two helper files (connection and header), and five task pages. She does not forget the helper files, even though they are not task pages.
Link says
File is named
Case-sensitive server
Other server
add_term.php
Add_Term.php
not found
found
add_term.php
add_term.php
found
found
Youssef saves a file as Add_Term.php, but the link in the menu says add_term.php. On a server that is case-sensitive, the link cannot find the file. On a server that is not, it works. Using one lowercase spelling everywhere avoids the problem.
Class activity
For your own small site from last lesson, make a table with three columns: file name, job, and “seen by the visitor?”. Include one helper file that the visitor never sees. Use lowercase names with underscores.
Practice
1
Which file opens the connection to the database, and does the visitor see it?
connection.php; no, the visitor never sees it.
2
What does header.php hold?
The banner and the six links, shown at the top of every page.
3
How many files does the site have?
Eight.
4
Why write file names in one lowercase spelling?
Some servers are case-sensitive, so a link with different capital letters would not find the file.