php microproject.php
php microproject.php
“EXPENSE
TRACKER”
Submitted by
Sarvesh Jamadar
Sahil Dawange
Prajwal Ahire
Snehal Koli
Department of Computer
Engineering Sandip
Polytechnic Mahiravani,
Nashik - 422213
Affiliated to
Maharashtra State
Board of Technical Education
Certificate
This is to certify that Mr. Sarvesh Jitendra Jamadar with Roll No-03 has successfully completed Micro-
project in course “Computer Engineering” for the academic year 2024-25 as prescribed in the 'Assessment
Manual ' during his tenure of completing Sixth Semester of Diploma Program in Computer Engineering from
institute, Sandip Polytechnic with institute code 1167.
Certificate
This is to certify that Mr. Sahil Suresh Dawange with Roll No-11 has successfully completed Micro-project
in course “Computer Engineering” for the academic year 2024-25 as prescribed in the 'Assessment Manual '
during his/her tenure of completing Sixth Semester of Diploma Program in Computer Engineering from
institute, Sandip Polytechnic with institute code 1167.
Certificate
This is to certify that Mr. Prajwal Manik Ahire with Roll No-12 has successfully completed Micro- project
in course “Computer Engineering” for the academic year 2024-25 as prescribed in the ' Assessment Manual '
during his/her tenure of completing Sixth Semester of Diploma Program in Computer Engineering from
institute, Sandip Polytechnic with institute code 1167.
Certificate
This is to certify that Mr. Snehal Prabhakar Koli with Roll No-27 has successfully completed Micro-project
in course “Computer Engineering” for the academic year 2024-25 as prescribed in the ' Assessment Manual '
during his/her tenure of completing Sixth Semester of Diploma Program in Computer Engineering from
institute, Sandip Polytechnic with institute code 1167.
1.0 To provide a digital platform for tracking daily expenses and income.
2.0 To help users categorize and analyze their spending habits efficiently
1. Sql Database:
// Database connection
$host = "localhost";
$user = "root";
$pass = "";
$dbname = "expense_tracker";
$conn = new mysqli($host, $user, $pass, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Handle Registration
if (isset($_POST["register"])) {
$name = $_POST["name"];
$email = $_POST["email"];
$password = password_hash($_POST["password"], PASSWORD_DEFAULT);
$sql = "INSERT INTO users (name, email, password) VALUES ('$name', '$email',
'$password')";
if ($conn->query($sql)) {
echo "Registration successful. <a href='?login'>Login here</a>";
} else {
echo "Error: " . $conn->error;
}
}
// Handle Login
if (isset($_POST["login"])) {
$email = $_POST["email"];
$password = $_POST["password"];
<h2>Login</h2>
<form method="POST">
<input type="email" name="email" placeholder="Email" required><br>
<input type="password" name="password" placeholder="Password" required><br>
<button type="submit" name="login">Login</button>
</form>
<?php
} else {
// If user is logged in, show expense dashboard
$user_id = $_SESSION["user_id"];
$sql = "SELECT SUM(amount) AS total FROM expenses WHERE user_id=$user_id";
$result = $conn->query($sql);
$total = ($result->num_rows > 0) ? $result->fetch_assoc()["total"] : 0;
?>
<h2>Expense Dashboard</h2>
<p>Total Expenses: ₹<?php echo number_format($total, 2); ?></p>
<a href="?logout">Logout</a>
<h2>Add Expense</h2>
<form method="POST">
<input type="text" name="category" placeholder="Category" required><br>
<input type="number" step="0.01" name="amount" placeholder="Amount"
required><br>
<input type="text" name="description" placeholder="Description"><br>
<input type="date" name="date" required><br>
<button type="submit" name="add_expense">Add Expense</button>
</form>
<h2>Your Expenses</h2>
<table border="1">
<tr>
<th>Date</th>
<th>Category</th>
<th>Amount</th>
<th>Description</th>
</tr>
<?php
$sql = "SELECT * FROM expenses WHERE user_id=$user_id ORDER BY date
DESC";
$result = $conn->query($sql);
while ($row = $result->fetch_assoc()) {
?>
<tr>
<td><?php echo $row["date"]; ?></td>
<td><?php echo $row["category"]; ?></td>
<td>₹<?php echo number_format($row["amount"], 2); ?></td>
<td><?php echo $row["description"]; ?></td>
</tr>
<?php } ?>
</table>
<?php } ?>
Output :
Skill Developed / Learning outcome of this Micro-Project:
1. Database Operations & User Authentication – Gained hands-on experience in performing crud
(Create, Read, Update, Delete) operations using MySQL and managing user authentication securely.
2. Form Validation & Input Handling – Implemented client-side and server-side validation to
ensure secure and accurate user inputs.
3. PHP & Control Statements – Applied conditional statements, loops, and functions to manage
expense entries and user interactions dynamically.
4. Session Management & Security – Used PHP sessions to maintain user login states and ensure
secure access to personal financial records.
Applications
2. Personal Expense Management – Helps individuals track their daily, weekly, and monthly
expenses efficiently.
3. Budget Planning – Users can categorize expenses and analyze spending habits to plan their budget
effectively.
• Conclusion:
With the help of this project, we gained hands-on experience in PHP and MySQL while building a practical
Expense Tracker system. We explored various built-in features of PHP, such as session management, form
validation, database interactions, and CRUD operations. Additionally, we learned how to establish
communication between the server and database, ensuring smooth data handling
.References:
1. PHP CRUD Operations with MySQL – Guide on creating, reading, updating, and deleting records in a
MySQL database.
2. Building an Expense Tracker in PHP & MySQL – Example of an expense tracking system with source code.
3. Form Validation in PHP – How to validate user input in PHP.
4. PHP Sessions and Cookies – Managing user sessions for login and authentication.
5. Bootstrap 5 Documentation – Used for improving UI/UX design in the project.
WEEKLY PROGRESS REPORT
MICRO PROJECT
3. Collection of Data
3rd
5. Formulation of Content
5th
Sr
Name of Resource/Material Specification Qty. Remarks
No
Desktop with Intel Core 2 Duo 2.93 -
1 Hardware Resource GHz, RAM 4GB, SSD 160 GB 1
2 Software Resource Xampp, Notepad++ 1 -
3 Any Other Resource javatpoint 1 -
Course Title: Web Based Application Development with PHP Course Code:
(A) (B)
Total Marks
Process and Product Assessment Individual
(10 Marks)
(6 Marks) Presentation/Viva (4
Marks)
(A) (B)
Total Marks
Process and Product Assessment Individual
(10 Marks)
(6 Marks) Presentation/Viva (4
Marks)
(A) (B)
Total Marks
Process and Product Assessment Individual
(10 Marks)
(6 Marks) Presentation/Viva (4
Marks)
(A) (B)
Total Marks
Process and Product Assessment Individual
(10 Marks)
(6 Marks) Presentation/Viva (4
Marks)