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

HTML, PHP, publishing and the session

الأسبوع 2 · الوحدة ١ «أساسيات تصميم موقع الويب» (٢): HTML وPHP وبرنامج خادم الويب، نشر الموقع (محليًا أو باستضافة)، لغة SQL ونظام قاعدة البيانات، حزم تطبيقات الويب، الجلسة · 3 دروس
3

Ready-made kits, SQL and the session

ICT Secondary 2 Term 1, Unit 1, Topic 1: pp. 14–19
GoalSay what a web-server package, SQL and a session are for.
New words
web-server package · a ready-made bundle of a web server program, a database system and PHPSQL · the language used to talk to a relational databaseMySQL · a relational database management system (RDBMS): a program that stores tables and the relations between themsession · the way a server remembers a visitor from page to page
Explanation

Installing a web server, a database system and PHP one by one is slow, so free packages bundle all three. There is one for each operating system, and they differ in nothing important except the system they run on. SQL is the language you use to talk to a database. It has four main jobs: INSERT adds a record, SELECT shows records, UPDATE changes them and DELETE removes them. MySQL is one relational database management system: a program that keeps tables and the links between them. The session solves a problem: the web forgets the visitor after every page. With a session the server keeps a small note about the visitor, and the browser sends back a short id with each request, so the server knows who is asking. The site then allows or refuses a page by a condition. Never keep the password in the session: keep only a fact such as “member 12 is signed in”. Sign-in itself comes later in the year.

Worked examples
KitRuns onWeb serverMySQLPHP
Kit Asystem 1yesyesyes
Kit Bsystem 2yesyesyes
Kit Csystem 3yesyesyes
Three invented kits: Kit A runs on system 1, Kit B on system 2, Kit C on system 3. Each one contains the same three parts. Only the system differs.
Question on the pageAnswerResult
a member is signed in?yesshow the form
a member is signed in?noshow a message
Karim signs in. The server notes “member 12 is signed in” in his session. On the next page, add_term.php, the server asks: is a member signed in? If yes, it shows the form. If no, it shows a message. The password is not stored in the session.
Class activity

On paper, write the four SQL jobs in a table. Next to each, write one thing the club might want to do (for example: add a new book, show all books by one writer, change a book’s shelf, remove a lost book).

Practice
1
What three parts does a web-server package bundle?
2
Which SQL job shows records, and which one removes them?
3
Why does a site need a session?
4
What should a session never hold, and what may it hold instead?