Skip to main content

📚 | Exercise 3: Forms and Predefined Variables

This exercise aims to create a minimalist and non-secure system for user login and account creation. A JSON file named users.json will be used to store the users. The HTML form inputs have intentionally been simplified to facilitate the testing process of your code (if I had added required, you would have to fill in the fields each time).

Clone the project

If not already done, clone the project from https://github.com/PHP-BUT2-DACS/TP-TD

git clone https://github.com/PHP-BUT2-DACS/TP-TD.git

Do the exercises

  1. Start the PHP server in the /Session 2/Exercise3 directory
php -S localhost:8080
  1. Access the page http://localhost:8080/login.php

  2. Complete the exercises in Exercise 3. Feel free to ask for help if needed.

tip

To progress better in the exercise, it is recommended to fill in the files in this order:

  1. profile.php
  2. logout.php
  3. signup.php
  4. login.php
tip

Don't forget to check your users.json file after creating a user.

X

Graph View