Level 0 exam — harder

Exam — fresh questions

0.1 · Recall

1. What is PHP and where does it run?

PHP runs on the server; the visitor only receives the generated HTML.
0.1 · Application

2. Riad opens his page source in the browser: he sees only HTML, no line of PHP. Why?

Request → PHP → HTML cycle: only the result is sent to the client.
0.1 · Application

3. Riad must display the first name of each logged-in visitor. Why call it a dynamic page?

The server regenerates personalized HTML on each request, instead of fixed HTML.
0.1 · Arbitration

4. Riad is offered to check passwords only in browser-side JavaScript, with no PHP control. What verdict?

The user can bypass the client; sensitive matters belong to the server.
0.2 · Recall

5. What makes up a local PHP environment (AMP)?

The pack bundles the three preconfigured blocks for developing locally.
0.2 · Application

6. Riad just installed his pack in Constantine. Which move checks that everything works?

The PHP info page displayed proves the server executes the code.
0.2 · Application

7. Riad places bonjour.php in htdocs but opens it with a double-click from the explorer: the PHP code displays as plain text. What should he do?

Without going through localhost, no interpreter executes the code.
0.2 · Arbitration

8. Riad's site works locally but not online: an included file changes case. What diagnosis?

Classic local/production gap: case must be exact everywhere.
0.3 · Recall

9. What happens outside and inside the tags?

That is what makes PHP a natural templating language.
0.3 · Application

10. Riad writes echo 'Hello' without a semicolon and the error is reported on the next line. What to fix?

The forgotten semicolon is mistake #1; PHP often reports the line after.
0.3 · Application

11. In his template, Riad wants to display $prenom cleanly. What to choose?

Short syntax = concise echo for views, with data escaping.
0.3 · Arbitration

12. Riad's page mixes SQL queries and HTML over 300 unreadable lines. What verdict?

Separating logic and display keeps code readable and maintainable.
What's next?
Back to the guideGuide contents