Hello Saint-Glinglin

Exercise 1 of 6 in chapter 1 · 100 XP · 5 objectives checked by tests

Topics covered: echoVariableString

In Saint-Glinglin, the news has always traveled by mailbox. Madame Lou, the postwoman and editor-in-chief of the village gazette, has decided to put it online. She has even found a good old-fashioned stylesheet. All that's missing is you, and a few lines of PHP.

Your mission

  1. At the top of public/index.php, store the village name in a variable called $village, set to 'Saint-Glinglin'.
  2. In the header, use echo to print the title <h1>The Saint-Glinglin Gazette</h1>, using the variable instead of typing the name out in full.
  3. Right below it, print the slogan <p class="slogan">All the news from the village, or nearly.</p>.
  4. The browser tab title, in <title>, must also become “The Saint-Glinglin Gazette”, thanks to the same variable.

The preview on the right updates with every change. When you think you're done, run the tests: each objective you complete lights up.

Reminder

A PHP file mixes HTML, sent to the browser as is, and code between <?php and ?>, run on the server. echo writes text into the page. A variable keeps a value so you can reuse it: change it once, and the whole site follows.

Saint-Glinglin is a French village, and its gazette is written by French speakers: the code keeps their French names ($village, $numero, titre…). Each new name is translated the first time it appears.