E - Punishment Exercise

Create an Exercise Writer website that repeats a line of text a chosen number of times.

The website should:

  • Ask the user to enter a line of text
  • Ask the user how many times the line should be written
  • Send the data to exercise.php using the POST method
  • Retrieve both values using $_POST
  • Use a FOR loop to repeat the line the correct number of times
  • Display each repeated line on the page
  • Include a Back link to return to the form
 Line:




Times:




for ($i = 0; $i < 99; $i++)
{

}

The three parts control the loop:

  • $i = 0 — starts the counter at 0
  • $i < 99 — repeats while the counter is less than 99
  • $i++ — adds 1 to the counter after each repetition