This PHP script provides a simple signup system with error handling for checking input fields, email validity, and username/email availability in a MySQL database.
- PHP
- MySQL
- Create a MySQL database with a table named
users
containing columns forusername
,pwd
(password), andemail
. - Update the database connection settings in
config.php
with your MySQL database credentials. - Upload the files to your server.
The script uses the following error handlers:
Checks if any of the input fields (username, password, email) are empty.
Checks if the email format is invalid.
Checks if the username is already taken in the database.
Checks if the email is already registered in the database.
If any of these conditions are met, the corresponding error message is displayed to the user.
- Access the signup form (
signup.php
) through your web browser. - Fill in the required fields (username, password, email) and submit the form.
- If there are any errors, they will be displayed on the signup form.
- If there are no errors, the user will be added to the database.
This is a basic signup system for educational purposes. It is not intended for production use without further security enhancements.