![]() |
VOOZH | about |
In this article, we are going to build an Online FIR Web Application using PHP with MySQL. In this application, we can file cases from anywhere by their name, complaint, status (pending or solved), and date of incidence, date of registration. Only the admin can view, delete and update status. A complete list of all cases can be seen by only the admin.
Prerequisites: XAMPP Server, Basic Concepts of HTML, CSS, Bootstrap, PHP, and MySQL
We will follow the following steps to build this application.
Features of website:
Step 1: First, we must have to start the XAMPP server from the XAMPP control panel.
Open XAMPP Control Panel and start Apache and MySQL services. In the XAMPP folder, go to htdocs folder and create a folder named OnlineFIR. We will keep all the files in the project folder. There are many files inside this folder but the main functioning files are login.php, connect.php, register.php, index.php, registerfir.php,status.php.
Step 2: Create Database
Go to localhost/phpMyAdmin and create a database called fir_info. Under that, make three tables called fir, login, register.
Step 3: Open the editor of your choice. Create a file named connect.php for the database fir_info connection. The connection object is returned to the $conn variable.
Step 4: Create another file index.php.
This page contains the hyperlink of all other pages such as status.php, login.php, gallery.php, aboutus.php. On clicking on these links user can perform actions.
Output:
Step 5: Create another file named "register.php" and add the code.
This page is created to insert the user's information to the βregisterβ table in the βfir_infoβ database. The HTML form contains the fields like firstname, lastname, username, email, gender, dob, mobileno, password, repeatpassword for the user entry. When a button is clicked, we include the file βconnect.phpβ to connect the page with the database.
When the information is entered successfully in the "register" table, the user has to log in himself on going "sign-in", a login page will appear and the page will move to βlogin.phpβ.
register.php
Output:
Create register database table for creating the register database table.
CREATE TABLE register(
uid int(10) AUTO_INCREMENT PRIMARY KEY,
firstname varchar(255),
lastname varchar(255),
username varchar(255),
dob date,
gender ENUM('male','female'),
email varchar(255),
mobileno varchar(255),
password varchar(50),
repeatpassword varchar(50)
);
After inserting the query, the following output can be seen in the database.
The register table contains 10 fields as shown in the picture given below.
Step 6: Create another file named login.php. Users have to log in by entering their username and password. On clicking the "Log in" button, the user is reached on the "registerfir" page.
login.php
Output:
Create a login database table for creating the login database table.
CREATE TABLE login
(
uid int(10) AUTO_INCREMENT PRIMARY KEY,
username varchar(255),
userpassword varchar(255)
);
After inserting this query the following output can be seen in the database.
The login table contains 3 fields as shown in the picture given below.
Step 6: Create another file named registerfir.php and add the following code. Now user can file a case of any category such as lost and found, fraud, domestic violence, others, etc. Now the user has to go on the "status" button which is available on the "index.php" page.
registerfir.php
Output:
Create fir table for creating the fir database table.
CREATE TABLE fir(
s_no int(10) AUTO_INCREMENT PRIMARY KEY,
name varchar(255),
parent_name varchar(255),
age int(10),
address varchar(255),
gender ENUM('male','female'),
inc_datetime datetime(6),
reg_datetime datetime(6),
complaint varchar(255),
section int(20),
category varchar(255),
qui1 varchar(255) DEFAULT 'RAJ/FIR/2021/',
qid2 int(10) UNIQUE,
status varchar(255),
information text
);
The following output is seen in the database.
The fir table contains 15 fields as shown in the picture given below.
Step 7: Create another file named status.php and code the following lines.
By clicking on the status button, users have to enter their FIR number on the search bar to see their case status (solved or pending or other information).
status.php
Output:
After Login, the database looks like the following output.
After complaint FIR, the database looks like the following.
Output: To run the output you have to enter "localhost/onlineFIR/" in the URL bar of the browser.