0% found this document useful (0 votes)
15 views26 pages

PHP MiniProject-report

The micro-project aims to create a web-based car registration system that performs CRUD operations using HTML, CSS, and PHP, with a MySQL database for data management. It emphasizes improved organization, data accuracy, and user-friendly access to car records, while adhering to security and regulatory standards. The project includes a detailed methodology, required resources, and actual implementation steps for developing the system.

Uploaded by

ajshelke75
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views26 pages

PHP MiniProject-report

The micro-project aims to create a web-based car registration system that performs CRUD operations using HTML, CSS, and PHP, with a MySQL database for data management. It emphasizes improved organization, data accuracy, and user-friendly access to car records, while adhering to security and regulatory standards. The project includes a detailed methodology, required resources, and actual implementation steps for developing the system.

Uploaded by

ajshelke75
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Annexure - I

A Micro-Project Proposal

1.0 Aim of the Micro-Project:

Performing CRUD Operations on Cars Registration Form

2.0 Intended Course Outcomes:

a. Develop frontend program using HTML, CSS.

b. Performing CRUD operations on database.

3.0 Proposed methodology:


• Project Overview and Requirements.
• Design the GUI.
• Implementing MySQL queries.
• Implementing insert, select, update, delete queries.
• Integrating GUI with Logic.
• Documentation.

4.0 Resources Required

S. No. Resources required Specifications


1 Computer system Intel(R) Pentium CPU, RAM 4 GB

2 Operating System Windows 10, 64 Bit Operating System


3 Software’s Visual Studio Code, Notepad++

1
2
Annexure - II

Micro-Project Report

1.0 Rationale:
This car registration micro project addresses the need for a well-organized and centralized
system for managing car details. Manually tracking car data can be cumbersome and prone to
errors.

This project offers a user-friendly web interface to streamline car registration, data storage,
and retrieval. By storing information in a central database, the project ensures data accuracy
and facilitates easy access for viewing, editing, and deleting car records.

The system also presents data in a clear and organized table format, enabling efficient
browsing and analysis. This micro project ultimately aims to improve decision-making by
providing readily available and organized car information.

2.0 Aim of the Micro-Project:

“Performing CRUD Operations on Cars Registration Form”

3.0 Course Outcomes Achieved

a. Develop program using HTML, CSS & PHP

b. Client-Side and Server-Side Interaction.

c. Understanding of PHP Syntax

4.0 Actual Methodology Followed:


• Project Overview and Requirements.
• Design the GUI.
• Implementing MySQL queries.
• Implementing insert, select, update, delete queries.
• Integrating GUI with Logic.
• Documentation.

3
✓ Advantages:

• Enhanced Organization and Accessibility: This project replaces manual record-keeping


with a centralized database, making car data more organized, readily accessible, and easily
retrievable. No more searching through piles of paper or struggling to remember where
specific information is stored.
• Improved Data Accuracy: By eliminating manual data entry, the risk of errors and
inconsistencies is significantly reduced. The system can also enforce validation rules to
ensure data integrity.
• Simplified CRUD Operations: "CRUD" stands for Create, Read, Update, and Delete. This
project facilitates all these tasks through a user-friendly web interface. You can easily
register new cars, view existing entries, edit data as needed, and remove obsolete records.
• Efficient Data Visualization: The show_data.php page presents car data in a clean and
organized table format. This allows for easy browsing, sorting, and identification of specific
cars. You can quickly find the information you need without sifting through cluttered
records.
• Streamlined Reporting and Decision-Making: Having organized car data readily
available allows for the generation of reports and analysis of trends. This can support
informed decision-making related to car management, resource allocation, or other relevant
areas.

✓ Rules:

i. Data Validation:
Ensure that all input data is validated to prevent errors and protect the integrity of the
database.

ii. Security Measures:


Implement robust security measures such as encryption, user authentication, and access
controls to safeguard sensitive information.

iii. User Authentication:


Require users to authenticate themselves before accessing or modifying registration data to
prevent unauthorized access.

iv. Backup Procedures:


Regularly backup the database to prevent data loss in case of system failure or other
unforeseen events.

v. Regulatory Compliance:
Adhere to relevant regulations and guidelines governing data privacy and security,
particularly concerning the handling of personal information.

vi. Error Handling:


Implement effective error handling mechanisms to provide users with informative error
messages and ensure smooth operation of the system.

4
5.0 Actual Resources Used:

S. No. Resources required Specifications


1 Computer system Intel(R) Pentium CPU, RAM 4 GB

2 Operating System Windows 10, 64 Bit Operating System

3 Software’s VS Code, Notepad++

6.0 Source code of program:

“conn.php”
<?php
$hostname="localhost";
$username="root";
$password="";
$database="cars-register";

$conn=mysqli_connect($hostname,$username,$password,$database);
if(!$conn)
{
die("connection failed");
}

?>

“register_car.php”

<?php
session_start();
require 'conn.php';

if(isset($_POST['submit']))
{
$_SESSION['model'] = $_POST['name'];
$_SESSION['brand'] = $_POST['brand'];
$_SESSION['engine'] = $_POST['engine'];
$_SESSION['hp'] = $_POST['hp'];
$_SESSION['torque'] = $_POST['torque'];
$_SESSION['cc'] = $_POST['cc'];
$_SESSION['speed'] = $_POST['speed'];
$_SESSION['acceleration'] = $_POST['acceleration'];
$_SESSION['fuel'] = $_POST['fuel'];
$_SESSION['drive'] = $_POST['drive'];
$_SESSION['transmission'] = $_POST['transmission'];
$_SESSION['cylinder'] = $_POST['cylinder'];
$_SESSION['CarWeight'] = $_POST['weight'];
5
$_SESSION['price'] = $_POST['price'];

// Construct message with all session variables


$message = "Car details:\\n";
$message .= "Model: {$_SESSION['model']}\\n";
$message .= "Brand: {$_SESSION['brand']}\\n";
$message .= "Engine: {$_SESSION['engine']}\\n";
$message .= "Horsepower: {$_SESSION['hp']}\\n";
$message .= "Torque: {$_SESSION['torque']}\\n";
$message .= "Displacement: {$_SESSION['cc']}\\n";
$message .= "Speed: {$_SESSION['speed']}\\n";
$message .= "Acceleration: {$_SESSION['acceleration']}\\n";
$message .= "Fuel Capacity: {$_SESSION['fuel']}\\n";
$message .= "Drive Type: {$_SESSION['drive']}\\n";
$message .= "Transmission: {$_SESSION['transmission']}\\n";
$message .= "Cylinders: {$_SESSION['cylinder']}\\n";
$message .= "Car Weight: {$_SESSION['CarWeight']}\\n";
$message .= "Price: {$_SESSION['price']}";

// Display alert box with all session variables


echo "<script>alert('$message');</script>";
}

if(isset($_POST['submit']))
{
$model = $_POST['name'];
$brand = $_POST['brand'];
$engine = $_POST['engine'];
$hp = $_POST['hp'];
$torque = $_POST['torque'];
$cc = $_POST['cc'];
$speed = $_POST['speed'];
$acceleration = $_POST['acceleration'];
$fuel = $_POST['fuel'];
$drive = $_POST['drive'];
$transmission = $_POST['transmission'];
$cylinder = $_POST['cylinder'];
$CarWeight = $_POST['weight'];
$price = $_POST['price'];

$sql="INSERT INTO cars(Model, Manufacturer, Engine, Horsepower, Torque, Displacement, Speed,


Acceleration, FuelCapacity, DriveType, Transmission, Cylinders, `CarWeight`, `Price`)
VALUES('$model','$brand','$engine','$hp hp','$torque','$cc cc','$speed kmph','$acceleration','$fuel
L','$drive','$transmission','$cylinder','$CarWeight kg','Rs. $price')";

if(mysqli_query($conn,$sql))
{

6
echo "<script>if(confirm('Data inserted successfully. If you want to add one more record. Click
OK.')){location.assign('register_car.php');}else{location.assign('display.php');}</script>";

}
else
{
echo "<script>alert('Data is not inserted!');</script>";
}
}

?>

<html>
<head>
<meta charset="utf-8">
<title>Add your car</title>
<link rel="stylesheet" type="text/css" href="css/register-car.css">
</head>

<body>

<!-- cookie how many time view count -->


<?php
$countvisit = 1;

if(isset($_COOKIE['countvisit']))
{
$countvisit = $_COOKIE['countvisit'];
$countvisit ++;
}

setcookie('countvisit', $countvisit);
echo '<script>alert("You have visited '.$countvisit.' times");</script>';
?>

<!-- end cookie code -->

<div class="login-root">
<div class="box-root flex-flex flex-direction--column" style="min-height: 100vh;flex-grow: 1;">
<div class="loginbackground box-background--white padding-top--64">
<div class="loginbackground-gridContainer">
<div class="box-root flex-flex" style="grid-area: top / start / 8 / end;">
<div class="box-root" style="background-image: linear-gradient(white 0%, rgb(247, 250, 252)
33%); flex-grow: 1;">
</div>
</div>
<div class="box-root flex-flex" style="grid-area: 4 / 2 / auto / 5;">

7
<div class="box-root box-divider--light-all-2 animationLeftRight tans3s" style="flex-grow:
1;"></div>
</div>
<div class="box-root flex-flex" style="grid-area: 6 / start / auto / 2;">
<div class="box-root box-background--blue800" style="flex-grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grid-area: 7 / start / auto / 4;">
<div class="box-root box-background--blue animationLeftRight" style="flex-grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grid-area: 8 / 4 / auto / 6;">
<div class="box-root box-background--gray100 animationLeftRight tans3s" style="flex-grow:
1;"></div>
</div>
<div class="box-root flex-flex" style="grid-area: 2 / 15 / auto / end;">
<div class="box-root box-background--cyan200 animationRightLeft tans4s" style="flex-grow:
1;"></div>
</div>
<div class="box-root flex-flex" style="grid-area: 3 / 14 / auto / end;">
<div class="box-root box-background--blue animationRightLeft" style="flex-grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grid-area: 4 / 17 / auto / 20;">
<div class="box-root box-background--gray100 animationRightLeft tans4s" style="flex-grow:
1;"></div>
</div>
<div class="box-root flex-flex" style="grid-area: 5 / 14 / auto / 17;">
<div class="box-root box-divider--light-all-2 animationRightLeft tans3s" style="flex-grow:
1;"></div>
</div>
</div>
</div>
<div class="box-root padding-top--24 flex-flex flex-direction--column" style="flex-grow: 1; z-
index: 9;">
<div class="box-root padding-bottom--24 flex-flex flex-justifyContent--center">
<h1><a href="#" rel="dofollow">Add your car</a></h1>
</div>
<div class="formbg-outer">
<div class="formbg">
<div class="formbg-inner padding-horizontal--48">
<span class="padding-bottom--15">Tell us about your car</span><br>
<form id="stripe-login" method="post">
<div class="field padding-bottom--24">
<div class="grid--50-50">
<label>Model</label>
<label>Manufacturer</label>
</div>
<div class="grid--50-50">
<input type="text" name="name" placeholder="Enter Model">
<input type="text" name="brand" placeholder="Enter Manufacturer">

8
</div>
</div>
<div class="field padding-bottom--24">
<label>Engine Details</label>
<input type="text" name="engine" placeholder="A twin-turbocharged V6 engine">
</div>

<div class="field padding-bottom--24">


<div class="grid--30-30-30">
<label>Horsepower (HP)</label>
<label>Torque</label>
<label>Displacement (cc)</label>
</div>
<div class="grid--30-30-30">
<input type="text" name="hp" placeholder="HP">
<input type="text" name="torque" placeholder="Nm">
<input type="text" name="cc" placeholder="cc">
</div>
</div>

<div class="field padding-bottom--24">


<div class="grid--30-30-30">
<label>Top Speed</label>
<label>Acceleration</label>
<label>FuelCapacity</label>
</div>
<div class="grid--30-30-30">
<input type="text" name="speed" placeholder="kmph">
<input type="text" name="acceleration" placeholder="0-100kmph in 4.1sec">
<input type="text" name="fuel" placeholder="Litre">
</div>
</div>

<div class="field padding-bottom--24">


<div class="grid--30-30-30">
<label>DriveType</label>
<label>Transmission</label>
<label>No. of Cylinders</label>

</div>
<div class="grid--30-30-30">
<select name="drive"class="field">
<option value="FWD">FWD</option>
<option value="RWD">RWD</option>
<option value="AWD (4x4)">AWD (4x4)</option>
</select>
<select name="transmission"class="field">
<option value="Manual">Manual</option>

9
<option value="Semi-Automatic">Semi-Automatic</option>
<option value="Automatic">Automatic</option>
</select>
<select name="cylinder"class="field">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="8">8</option>
<option value="10">10</option>
<option value="12">12</option>
<option value="16">16</option>
</select>
</div>
</div>

<div class="field padding-bottom--24">


<div class="grid--50-50">
<label>Car Weight</label>
<label>Price (IND)</label>
</div>
<div class="grid--50-50">
<input type="text" name="weight" placeholder="kg">
<input type="text" name="price" placeholder="₹ ">
</div>
</div>

<!-- <div class="field field-checkbox padding-bottom--24 flex-flex align-center">


<label for="checkbox">
<input type="checkbox" name="checkbox"> Stay signed in for a week
</label>
</div> -->
<div class="field padding-bottom--24">
<input type="submit" name="submit" value="Continue">
</div>

<div class="field padding-bottom--24">


<a class="ssolink" href="display.php" name="btn">View</a>
</div>
<!-- <div class="field">
<a class="ssolink" href="#">Use single sign-on (Google) instead</a>
</div> -->
</form>
</div>
</div>
<!-- <div class="footer-link padding-top--24 padding-bottom--24">

10
<span>Don't have an account? <a href="">Sign up</a></span>
</div> -->
</div>
</div>
</div>
</div>
</body>

</html>

“display.php”

<?php
$hostname="localhost";
$username="root";
$password="";
$database="cars-register";

$conn=mysqli_connect($hostname,$username,$password,$database);
if(!$conn)
{
die("connection failed");
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Database</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="styles.css">
<style>

body {
margin: 10px;
font-family: Arial, sans-serif;
}

*{
box-sizing: border-box;
}
11
form.example input[type=text] {
padding: 10px;
font-size: 17px;
border: .5px solid grey;
border-radius: 5px 0 0 5px;
float: left;
width: 80%;
}

form.example button {
float: left;
width: 20%;
padding: 10px;
background: #2196F3;
color: white;
font-size: 17px;
border: 1px solid grey;
border-radius: 0px 6px 6px 0px;
border-left: none;
cursor: pointer;
}

form.example button:hover {
background: #0b7dda;
}

form.example::after {
content: "";
clear: both;
display: table;
}

.table-container {
margin: 10px auto;
width: 100%;
overflow-x: auto; /* Horizontal scrolling for small screens */
}

table {
width: 100%;
border-collapse: collapse;
border-radius: 8px;

12
overflow: hidden;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); /* Add shadow effect */
}

tr, th, td {
padding: 12px 10px;
text-align: left;
border-bottom: 1px solid #f0f0f0;
font-size: 11px;
}

tr, th {
background-color: #ededed;
color: #333;
text-align: center;
font-size: 12px;
}

tbody tr:nth-child(even) {
background-color: #f9f9f9;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
.table-container {
width: 100%;
}

table {
border-radius: 0;
box-shadow: none;
}

th, td {
padding: 10px 8px;
}
}

.showbtn {
display: flex;
justify-content: center;
}
.action-btn {

13
font-size:10px;
height: 25px;
width: 70px;
background-color:#2196F3;
color: white;
border: none;
border-radius: 5px;
}
.btn-add {
margin-top: 20px;
font-size:10px;
height: 30px;
width: 100px;
background-color:#2196F3;
color: white;
border: none;
border-radius: 5px;
}
</style>
</head>
<body>
<form class="example" action="#" method="get" style="margin:auto;max-
width:300px; margin-top: 20px; margin-bottom: 20px;">
<input type="text" placeholder="Search.." name="search" value="<?php
if(isset($_GET['search'])){echo $_GET['search']; } ?>">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
<div class="table-container">
<table>
<thead>
<tr>
<th>ID</th>
<th>Model Name</th>
<th>Manufacturer</th>
<th>Engine</th>
<th>Horsepower</th>
<th>Torque</th>
<th>Displacement</th>
<th>Speed</th>
<th>Acceleration</th>
<th>Fuel Capacity</th>
<th>Drive Type</th>
<th>Transmission</th>

14
<th>Cylinders</th>
<th>Car Weight</th>
<th>Price</th>
<th colspan="2">Action</th>
</tr>
</thead>
<tbody>
<?php
if(isset($_GET['search'])){
$filtervalues = $_GET['search'];
$query = "SELECT * FROM cars WHERE CONCAT(Id,Model,
Manufacturer, Engine, Horsepower, Torque, Displacement, Speed, Acceleration,
FuelCapacity, DriveType, Transmission, Cylinders, 'CarWeight', Price) LIKE
'%$filtervalues%' ";
$query_run = mysqli_query($conn, $query);

if(mysqli_num_rows($query_run) > 0){


foreach($query_run as $items){
?>
<tr>
<td><?= $items['Id']; ?></td>
<td><?= $items['Model']; ?></td>
<td><?= $items['Manufacturer']; ?></td>
<td><?= $items['Engine']; ?></td>
<td><?= $items['Horsepower']; ?></td>
<td><?= $items['Torque']; ?></td>
<td><?= $items['Displacement']; ?></td>
<td><?= $items['Speed']; ?></td>
<td><?= $items['Acceleration']; ?></td>
<td><?= $items['FuelCapacity']; ?></td>
<td><?= $items['DriveType']; ?></td>
<td><?= $items['Transmission']; ?></td>
<td><?= $items['Cylinders']; ?></td>
<td><?= $items['CarWeight']; ?></td>
<td><?= $items['Price']; ?></td>
<td>
<a href="update.php?Id=<?php echo $items['Id'];?>" style="text-
decoration: none; color: red;"><button style=" font-size:10px; height: 20px;width:
50px; background-color: lightblue;color: gray;border: 1px solid black; border-
radius: 5px;">Edit</button></a>
</td>
<td>
<a href="RemoveCarData.php?Id=<?php echo $items['Id']; ?>"

15
name="delete_<?php echo $items['Id']; ?>" style="text-decoration: none;color:
tomato; font-size: 13px;">Delete</a>
</td>
</tr>
<?php
}

} else {
?>
<tr>
<td colspan="4">No Record Found</td>
</tr>
<?php
}
}
if(!isset($_GET['search'])) {
$sql = "select * from cars";
$query_result=mysqli_query($conn,$sql);

while($row = mysqli_fetch_assoc($query_result))
{
?>
<tr>
<td><?php echo $row['Id']; ?></td>
<td><?php echo $row['Model']; ?></td>
<td><?php echo $row['Manufacturer']; ?></td>
<td><?php echo $row['Engine']; ?></td>
<td><?php echo $row['Horsepower']; ?></td>
<td><?php echo $row['Torque']; ?></td>
<td><?php echo $row['Displacement']; ?></td>
<td><?php echo $row['Speed']."kmph"; ?></td>
<td><?php echo $row['Acceleration']; ?></td>
<td><?php echo $row['FuelCapacity']; ?></td>
<td><?php echo $row['DriveType']; ?></td>
<td><?php echo $row['Transmission']; ?></td>
<td><?php echo $row['Cylinders']; ?></td>
<td><?php echo $row['CarWeight']; ?></td>
<td><?php echo $row['Price']; ?></td>
<td>
<a href="update.php?Id=<?php echo $row['Id'];?>" style="text-
decoration: none; color: red;"><button class="action-btn">Edit</button></a>
</td>
<td>

16
<a href="RemoveCarData.php?Id=<?php echo $row['Id']; ?>"
name="delete_<?php echo $row['Id']; ?>" style="text-decoration: none;color:
tomato; font-size: 13px;">Delete</a>
</td>
</tr>
<?php

}
}
mysqli_close($conn);
?>

</tbody>
</table>
<div class="showbtn">
<a href="register_car.php" style="text-decoration: none;"><button
class="btn-add">Add</button></a>
</div>
</div>
</body>
</html>

“update.php”

<?php
error_reporting(E_ALL);
$hostname="localhost";
$username="root";
$password="";
$database="cars-register";

$conn=mysqli_connect($hostname,$username,$password,$database);
if(!$conn)
{
die("connection failed");
} else {
// echo "<script>alert('Connected Successfully');</script>";
}

if(isset($_GET['Id']) && !empty($_GET['Id'])) {


// Escape user inputs to prevent SQL injection
$Id = trim($_GET['Id']);

17
$sql_select = "SELECT * FROM cars WHERE Id = $Id";
$result = $conn->query($sql_select);
$row = $result->fetch_assoc();

if ($row) {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Retrieve form data
$name = $conn->real_escape_string($_POST['model']);
$brand = $conn->real_escape_string($_POST['brand']);
$engine = $conn->real_escape_string($_POST['engine']);
$hp = $conn->real_escape_string($_POST['hp']);
$torque = $conn->real_escape_string($_POST['torque']);
$cc = $conn->real_escape_string($_POST['cc']);
$speed = $conn->real_escape_string($_POST['speed']);
$acceleration = $conn->real_escape_string($_POST['acceleration']);
$fuel = $conn->real_escape_string($_POST['fuel']);
$drive = $conn->real_escape_string($_POST['drive']);
$transmission = $conn->real_escape_string($_POST['transmission']);
$cylinder = $conn->real_escape_string($_POST['cylinder']);
$CarWeight = $conn->real_escape_string($_POST['weight']);
$price = $conn->real_escape_string($_POST['price']);

// $sql_update = "UPDATE cars SET


Id='$Id',Model='$name',Manufacturer='$brand',Engine='$engine',Horsepower='$hp',
Torque='$torque',Displacement='$cc',Speed='$speed',Acceleration='$acceleration','F
uelCapacity'='$fuel','DriveType'='$drive',Transmission='$transmission',Cylinders='$c
ylinder','CarWeight'='$CarWeight',Price='$price' WHERE Id = $Id";

$sql_update = "UPDATE cars SET Model = '$name', Manufacturer = '$brand',


Engine = '$engine', Horsepower = '$hp', Torque = '$torque', Displacement = '$cc',
Speed = '$speed', Acceleration = '$acceleration', FuelCapacity = '$fuel', DriveType =
'$drive', Transmission = '$transmission', Cylinders = '$cylinder', CarWeight =
'$CarWeight', Price = '$price' WHERE Id = $Id";

if ($conn->query($sql_update) === TRUE) {


echo "<script>alert('Record updated successfully');</script>";
echo "<script>location.assign('show_data.php');</script>";
} else {
echo "Error updating record: " . $conn->error;
}
}

18
?>

<html>
<head>
<title>Update the details</title>
<link rel="stylesheet" type="text/css" href="css/register-car.css">
</head>

<body>
<div class="login-root">
<div class="box-root flex-flex flex-direction--column" style="min-height:
100vh;flex-grow: 1;">
<div class="loginbackground box-background--white padding-top--64">
<div class="loginbackground-grIdContainer">
<div class="box-root flex-flex" style="grId-area: top / start / 8 / end;">
<div class="box-root" style="background-image: linear-gradient(white 0%,
rgb(247, 250, 252) 33%); flex-grow: 1;">
</div>
</div>
<div class="box-root flex-flex" style="grId-area: 4 / 2 / auto / 5;">
<div class="box-root box-divIder--light-all-2 animationLeftRight tans3s"
style="flex-grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grId-area: 6 / start / auto / 2;">
<div class="box-root box-background--blue800" style="flex-grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grId-area: 7 / start / auto / 4;">
<div class="box-root box-background--blue animationLeftRight" style="flex-
grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grId-area: 8 / 4 / auto / 6;">
<div class="box-root box-background--gray100 animationLeftRight tans3s"
style="flex-grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grId-area: 2 / 15 / auto / end;">
<div class="box-root box-background--cyan200 animationRightLeft tans4s"
style="flex-grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grId-area: 3 / 14 / auto / end;">
<div class="box-root box-background--blue animationRightLeft" style="flex-
grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grId-area: 4 / 17 / auto / 20;">

19
<div class="box-root box-background--gray100 animationRightLeft tans4s"
style="flex-grow: 1;"></div>
</div>
<div class="box-root flex-flex" style="grId-area: 5 / 14 / auto / 17;">
<div class="box-root box-divIder--light-all-2 animationRightLeft tans3s"
style="flex-grow: 1;"></div>
</div>
</div>
</div>
<div class="box-root padding-top--24 flex-flex flex-direction--column" style="flex-
grow: 1; z-index: 9;">
<div class="box-root padding-bottom--24 flex-flex flex-justifyContent--center">
<h1><a href="#" rel="dofollow">Change the details</a></h1>
</div>
<div class="formbg-outer">
<div class="formbg">
<div class="formbg-inner padding-horizontal--48">
<form id="stripe-login" method="post">
<div class="field padding-bottom--24">
<!-- <div class="field padding-bottom--24">
<label>Id</label>
<input type="text" name="Id" value="<?php echo $row['Id']; ?>"/>
</div> -->
<div class="grId--50-50">
<label>Model</label>
<label>Manufacturer</label>
</div>
<div class="grId--50-50">
<input type="text" name="model" value="<?php echo $row['Model']; ?>"
/>
<input type="text" name="brand" value="<?php echo
$row['Manufacturer']; ?>" />
</div>
</div>
<div class="field padding-bottom--24">
<label>Engine Details</label>
<input type="text" name="engine" value="<?php echo $row['Engine']; ?>"
/>
</div>

<div class="field padding-bottom--24">


<div class="grId--30-30-30">
<label>Horsepower (HP)</label>

20
<label>Torque</label>
<label>Displacement (cc)</label>
</div>
<div class="grId--30-30-30">
<input type="text" name="hp" value="<?php echo $row['Horsepower']; ?>"
/>
<input type="text" name="torque" value="<?php echo $row['Torque']; ?>"
/>
<input type="text" name="cc" value="<?php echo $row['Displacement'];
?>"/>
</div>
</div>

<div class="field padding-bottom--24">


<div class="grId--30-30-30">
<label>Top Speed</label>
<label>Acceleration</label>
<label>FuelCapacity</label>
</div>
<div class="grId--30-30-30">
<input type="text" name="speed" value="<?php echo $row['Speed']; ?>"/>
<input type="text" name="acceleration" value="<?php echo
$row['Acceleration']; ?>" />
<input type="text" name="fuel" value="<?php echo $row['FuelCapacity'];
?>" />
</div>
</div>

<div class="field padding-bottom--24">


<div class="grId--30-30-30">
<label>DriveType</label>
<label>Transmission</label>
<label>No. of Cylinders</label>

</div>
<div class="grId--30-30-30">
<select name="drive" class="field">
<?php $val =$row['DriveType']; echo "<option
value='$val'>$val</option>"; ?>
<option value="FWD">FWD</option>
<option value="RWD">RWD</option>
<option value="AWD (4x4)">AWD (4x4)</option>
</select>

21
<select name="transmission" class="field">
<?php $val = $row['Transmission']; echo "<option
value='$val'>$val</option>"; ?>
<option value="Manual">Manual</option>
<option value="Semi-Automatic">Semi-Automatic</option>
<option value="Automatic">Automatic</option>
</select>
<select class="field" name="cylinder">
<?php $val = $row['Cylinders']; echo "<option
value='$val'>$val</option>"; ?>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="8">8</option>
<option value="10">10</option>
<option value="12">12</option>
<option value="16">16</option>
</select>
</div>
</div>

<div class="field padding-bottom--24">


<div class="grId--50-50">
<label>CarWeight</label>
<label>Price (IND)</label>
</div>
<div class="grId--50-50">
<input type="text" name="weight" value="<?php echo $row['CarWeight'];
?>" />
<input type="text" name="price" value="<?php echo $row['Price']; ?>" />
</div>
</div>

<!-- <div class="field field-checkbox padding-bottom--24 flex-flex align-


center">
<label for="checkbox">
<input type="checkbox" name="checkbox"> Stay signed in for a week
</label>
</div> -->
<div class="field padding-bottom--24">

22
<input type="submit" name="submit" value="Change">
</div>
<div class="field">
<a class="ssolink" href="show_data.php">Show</a>
</div>
</form>

</div>
</div>
</div>
</div>
</div>
</div>
</body>

</html>

<?php
var_dump($row);
} else {
echo "Record not found";
}
} else {
echo "ID parameter not set or empty";
}

mysqli_close($conn);
?>

“RemoveCarData.php”
<?php
require 'conn.php';

if(isset($_GET['Id']) && !empty($_GET['Id'])) {


$Id = $conn->real_escape_string($_GET['Id']);

$sql = "DELETE FROM cars WHERE Id = $Id";

if ($conn->query($sql) === TRUE) {


// echo "<script>alert('Record deleted successfully');</script>";
echo "<script>window.location.assign('show_data.php');</script>";
} else {
echo "Error deleting record: " . $conn->error;
23
}
} else {
echo "ID parameter not set or empty";
}

mysqli_close($conn);
?>

7.0 Output:
Register_car.php

show_data.php

24
update.php

8.0 Skills Developed:


1. Programming Skills (PHP, HTML, CSS, JavaScript): You'll develop proficiency in server-
side scripting with PHP for handling form submissions, database interactions, and dynamic
content generation. HTML and CSS skills are essential for designing user interfaces, while
JavaScript may be utilized for client-side interactivity and validation.

2. Database Management (MySQL or similar): You'll gain experience in database design,


normalization, and management using MySQL or a similar relational database
management system. Skills in SQL (Structured Query Language) will be essential for
querying, inserting, updating, and deleting data from the database.

3. HTML and CSS: While the project likely focuses on functionality, you'll gain exposure to
HTML for structuring web pages and CSS for styling the data display.

4. Form Validation: You'll understand how to implement validation rules to ensure users
enter data in the correct format and prevent malicious input.
5. Problem-Solving: You'll encounter challenges during development, requiring you to
troubleshoot and find solutions, honing your problem-solving skills.

9.0 Applications of this Micro-project:


1. Individual Car Management
2. Small Business Applications
3. Educational Institutions
4. Community Car Sharing Programs
5. Simple Parking Management
6. Government Agencies

25
7. Fleet Management Companies
8. Insurance Companies
9. Law Enforcement Agencies
10. Parking Management Systems

10.0 Conclusion:
In conclusion, the development of the "Car Registration System" project represents a
significant step towards modernizing and streamlining the management of vehicle registration
details. Through the utilization of PHP, MySQL, HTML, and other web technologies, this
project has successfully achieved its objectives of automating the registration process,
centralizing data management, and enhancing overall efficiency and accuracy.

This car registration micro project serves as a valuable introduction to web development
concepts using PHP and database management. It demonstrates the power of these technologies
to streamline data collection, organization, and retrieval.

Key Achievements:
• The project successfully implements CRUD (Create, Read, Update, Delete) operations for
car data, providing a user-friendly interface for managing car information.

• By utilizing a central database, the system ensures data accuracy, accessibility, and
efficient record-keeping compared to manual methods.

• The project provides a clear visual representation of car data in a tabular format,
facilitating easy browsing, sorting, and analysis.

11.0 Reference
1. The official PHP documentation provides comprehensive information and examples for
using PHP in web development, including database operations.
• https://www.php.net/manual/en/

2. W3Schools PHP Tutorial: W3Schools offers a beginner-friendly tutorial on PHP that


covers various aspects, including database operations.
• https://www.w3schools.com/php/

3. PHP CRUD Tutorial by Tutorial Republic: This tutorial provides step-by-step instructions
on creating a PHP CRUD application, including a registration form.
• https://www.tutorialrepublic.com/php-tutorial/php-mysql-crud-application.php

4. MySQL Documentation: For database-related operations, MySQL's official documentation


is a valuable resource.
• https://dev.mysql.com/doc/

26

You might also like