This is a simple PHP application that allows users to input and validate data, which is then stored in a MongoDB database. The application enforces various validation rules to ensure data integrity and prevent duplicate records.
Before using this application, ensure you have the following prerequisites:
-
MongoDB: You must have MongoDB installed and running on your server or local environment.
-
PHP: This application is written in PHP, so you need to have PHP installed. I've used version 8.1.17.
-
Clone this repository to your local machine using the following command:
git clone https://github.com/AbdulDavids/CodeInfinity.git
-
Change into the project directory:
cd CodeInfinity -
Install the MongoDB PHP driver using Composer:
composer install
-
Start your MongoDB server if it's not already running.
-
Configure the MongoDB connection settings in the PHP script (
index.php). Update the following lines with your MongoDB connection details:$mongoClient = new MongoDB\Client("mongodb://localhost:27017"); $database = $mongoClient->your_database_name; // Replace with your database name $collection = $database->your_collection_name; // Replace with your collection name
-
Run the PHP script by accessing it through your web server. For example, if you're using a local development server, you can access the script at
http://localhost/codeinfinity/index.php. -
Fill out the form with the required information: Name, Surname, ID Number, and Date of Birth (in the format dd/mm/YYYY).
-
Click the "POST" button to submit the form.
-
The application will validate the data and store it in the MongoDB database if it passes all validation checks. If there are validation errors or duplicate ID Numbers, appropriate error messages will be displayed to the user.
You can customize the application by modifying the PHP script (index.php) to suit your specific needs.