Apprendre PHP (Hors-série) - Inscription et authentification via un fichier texte

8 Apr 2019 · 17 min
17:18

In this French‑language tutorial, the presenter walks through building a simple user registration and login system in PHP that stores user data in a plain‑text file. He creates four PHP scripts: index.php (registration form), login.php (authentication form), session.php (protected page), and a logout script. The video demonstrates step‑by‑step form validation using regular expressions for name and first name, basic checks for empty login and password fields, and password confirmation. When validation passes, the script opens the data file in "a+" mode, appends a line containing the name, first name, login and an MD5‑hashed password, ensuring a newline separator. For authentication, the login script reads the file line‑by‑line in read‑only mode, splits each line on the colon delimiter with explode, trims the trailing newline, and compares the supplied login and MD5‑hashed password against the stored values. Upon a successful match, a session is started, user details are stored in session variables, and the user is redirected to session.php, which checks the session before displaying the protected content. A logout script destroys the session. The tutorial also notes practical considerations such as handling Windows line endings, the limitation of not checking login uniqueness, and the insecure nature of MD5 hashing, but keeps the implementation simple for educational purposes.

Chapters

More from Yamossoun

8:56
youtube.com

Compteur synchrone - Logique séquentielle

2w ago
11:58
youtube.com

Compteur asynchrone et diviseur de fréquence - Logique séquentielle

3w ago
11:37
youtube.com

Les registres (parallèle et à décalage) - Logique séquentielle

1mo ago
6:14
youtube.com

Bascule T (Toggle) - Logique séquentielle

1mo ago
12:05
youtube.com

Bascule JK - Logique séquentielle

1mo ago
9:17
youtube.com

Bascule D flip-flop active sur front montant - Logique séquentielle

1mo ago
10:08
youtube.com

Bascule D Latch - Logique séquentielle

1mo ago
8:13
youtube.com

Bascule RS - Logique séquentielle

1mo ago
5:04
youtube.com

Logique séquentielle - Introduction

2mo ago
1:15
youtube.com

Le codeur - Logique combinatoire #codeur #logique #circuit #booleanlogic

2mo ago
1:56
youtube.com

Algorithme de calcule de la racine carrée par dichotomie #dichotomy #squareroot #algorithm

3mo ago
See all content