Oddbean new post about | logout
 #Bitcoin Block Art by Blockstr!
Height: 839513
Weight: 3993081
https://thebitcoinblockclock.com/blockstr/0000000000000000000025e7566c6a0b95eff20f94791e3cc2ff4d1cf5c8c96f.png 
 
   This page contains an example of a simple PHP script that uses a text file to store information about users. Each line in the file contains information about one user, with the format being: first name, last name, email address.
   The script allows users to add new users, edit existing users, and delete users from the file. It also displays all users in the file.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>User Management</title>
</head>
<body>
    <h1>User Management</h1>

    <!-- Add user form -->
    <form action="add_user.php" method="post">
        First Name: <input type="text" name="first_name"><br>
        Last Name: <input type="text" name="last_name"><br>
        Email Address: <input type="email" name="email"><br>
        <input type="submit" value="Add User">
    </form>

    <!-- Display users form -->
    <form action="display_users.php" method="post">
        <input type="submit" value="Display Users">
    </form>

    <!-- Edit user form -->
    <form action="edit_user.php" method="post">
        User ID: <input type="number" name="user_id"><br>
        First Name: <input type="text" name="first_name"><br>
        Last Name: <input type="text" name="last_name"><br>
        Email Address: <input type="email" name="email"><br>
        <input type="submit" value="Edit User">
    </form>

    <!-- Delete user form -->
    <form action="delete_user.php" method="post">
        User ID: <input type="number" name="user_id"><br>
        <input type="submit" value="Delete User">
    </form>
</body>
</html>