HTML, PHP, publishing and the session
Answers are for parents and teachers.
1
Put in order: PHP engine runs the code; browser asks for books.php; plain HTML goes back; web server program receives the request.
Browser asks; web server program receives; PHP engine runs the code; plain HTML goes back.
2
A pupil says: “PHP is translated into HTML and sent with the page as PHP.” Find and correct the mistake.
The PHP is not sent at all. The server runs it, and only the HTML that comes out is sent to the browser.
3
Choose localhost or hosting and give a reason: (a) testing a button today, (b) a page that parents will read, (c) a page you are still deleting and rewriting.
(a) localhost, only you need it; (b) hosting, it must be always on and open; (c) localhost, nobody should see it unfinished.
4
Write which SQL job fits: (a) add a new term, (b) show all terms, (c) correct a typing mistake in a term, (d) remove a term.
(a) INSERT; (b) SELECT; (c) UPDATE; (d) DELETE.
5
Explain in two sentences why a session must not store a password.
A password is a secret, and a session is passed along from page to page. Keeping only “member 12 is signed in” lets the site work without exposing the secret.