0% found this document useful (0 votes)
29 views17 pages

Miraj PHP Report

The document is a project report on a Temperature Converter developed by Miraj Shaikh Rahim for a Diploma in Computer Engineering at Government Polytechnic, Jalgaon. It outlines the project's objectives, advantages, disadvantages, and the coding involved in creating a web-based application that converts temperature values between Celsius, Fahrenheit, and Kelvin. The report emphasizes the educational value of the project and the practical skills gained by the student through its development.

Uploaded by

gtotal663
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)
29 views17 pages

Miraj PHP Report

The document is a project report on a Temperature Converter developed by Miraj Shaikh Rahim for a Diploma in Computer Engineering at Government Polytechnic, Jalgaon. It outlines the project's objectives, advantages, disadvantages, and the coding involved in creating a web-based application that converts temperature values between Celsius, Fahrenheit, and Kelvin. The report emphasizes the educational value of the project and the practical skills gained by the student through its development.

Uploaded by

gtotal663
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/ 17

`

A Project Report on
Tempreature Converter
In the partial fulfillment of the Diploma in Computer Engineering for the academic Year
2024-25
Submitted to

GOVERNMENT POLYTECHNIC, JALGAON


Submitted by
Roll No. Name of the Student Class
90 Miraj Shaikh Rahim CO6I

Under the Guidance of


Prof. Ganesh Palbe Sir
Lecturer in WBP
Department of Computer Engineering
Government Polytechnic, Jalgaon
`

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


CERTIFICATE

This is to certify that Roll No.90 of Sixth Semester of Diploma in Computer Engineering
of Institute Government Polytechnic, Jalgaon (0018) has completed the Micro Project
satisfactorily in the Subject WBP (22619) for the Academic Year 2024-25 as prescribed in
the curriculum.

Place: Jalgaon EnrollmentNo.2100180298


Date: Exam Seat No:

Subject Teacher . Head of the Department Principal

Seal of
Institut
ion
`

(Academic Year: 2024-25)


Name of the Student: Miraj Shaikh Rahim Roll No: 90
Course: WBP Course Code:(22619)
Title of the Project: Tempreature Converter

Agency Cos addressed by Micro Project:

a) Understand how to collect and process data from HTML forms in PHP.

b) Apply conditional statements and arithmetic operations to create a temperature conversion logic.

c)Combine HTML and PHP in a single project, enabling dynamic interaction.

Major learning outcomes achieved by students by doing the project:


a) Practical outcome:
1) Create a user interface where users can input temperature and select conversion types (Celsius to Fahrenheit, etc.).
b) Unit outcomes in Cognitive Domain:
1)Process the input and display real-time results after conversion.
c) Out comes in affective domain:
1) Function as a team member
2) Follow ethics

Comments/suggestions about teamwork/leadership/interpersonal communications (if any):


Marks out of
Marks out of
04 for
06 for
performance
performance Total out
Roll No Student Name in oral or
in group of 10
presentation
activity (D5
(D5 Column
Column 08) 09)
90 Miraj Shaikh Rahim

Name & Signature of Faculty:

Prof. Ganesh Palbe Sir


`

INDEX

Sr. No. Content Page No.

1 Introduction 5

2 Scope Of Project 6

3 Advantages 7

4 Disadvantages 8

6 Future Scope 9

7 Code 10

8 Output 15

9 Conclusion 17

4
`

Introduction:

The Temperature Converter using PHP is a simple yet practical web-based


application designed to convert temperature values between different units—
primarily Celsius, Fahrenheit, and Kelvin. This project serves as an excellent
example of how core PHP functionalities can be used in combination with HTML to
create an interactive and user-friendly tool.

The converter allows users to input a temperature value, select the input and
desired output units, and instantly see the converted result. This project not only
demonstrates the use of arithmetic operations and conditional logic in PHP but also
emphasizes the integration of front-end and back-end development.

By working on this project, students gain hands-on experience in handling user


inputs, performing server-side processing, and displaying dynamic output—all
essential skills for web development. It also encourages logical thinking and
problem-solving, which are crucial in real-time application development.

5
`

Scope of project

The Temperature Converter using PHP is a basic web application that


demonstrates the use of server-side scripting for real-time data processing. The
primary goal of this project is to convert temperature values between different units
such as Celsius, Fahrenheit, and Kelvin using a clean and interactive interface.

This project has the following scope:


1. Educational Purpose
It helps students understand the basics of PHP, including form handling,
conditional statements, and mathematical operations.

2. Web-Based Accessibility
As a web-based tool, the converter can be accessed from any device with a
browser, making it a portable and platform-independent application.
3. User-Friendly Interface
The interface is simple and intuitive, allowing users to easily enter values and get
instant results without requiring any technical knowledge.

4. Expandable Logic
The project is designed in a modular way, so additional temperature units or even
other measurement converters (length, weight, etc.) can be added in the future.

5. Real-Time Data Processing


It showcases the ability of PHP to process user input on the server and return
immediate feedback without the need for database support.

6
`

Advantages

1. Easy to Understand and Implement


The project uses basic PHP and HTML concepts, making it ideal for beginners
learning server-side scripting and web development.

2. Platform Independent
Since it runs in a web browser, the converter can be used on any device (PC,
mobile, tablet) with internet access—no special software needed.

3. Real-Time Conversion
Users get instant results after entering a value, which enhances the user
experience and demonstrates the power of server-side processing.

4. Customizable and Scalable


The logic and structure of the code are simple, making it easy to expand by
adding more temperature units or converting other measurements like distance or
weight.

5. Educational Value
This project reinforces important programming concepts such as user input
handling, conditional statements, and form validation.

6. No Need for Database


The project is self-contained and doesn't require a database, reducing complexity
and resource requirements.

7. Accuracy in Output
The converter provides mathematically accurate results, which is essential for
scientific and educational use.

7
`

Disadvantages

1. No Data Storage
The application doesn’t use a database, so it can’t save or log previous
conversions for later use or analysis.

2. Limited Functionality
It only performs temperature conversions. It does not support other units (like
weight, distance, etc.) unless manually extended.

3. Basic User Interface


The design is simple and lacks modern UI/UX features like animations,
dropdowns, or responsive styling unless enhanced with CSS/JavaScript.

4. No Offline Support
Since it’s a web-based application, users must have a working server
environment (like XAMPP) to run it locally, which may not be convenient for all
users.

5. No Client-Side Interactivity
All processing is server-side; there’s no use of JavaScript for instant feedback or
dynamic changes without reloading the page.

6. No Error Details
Input validation is basic—users aren't always guided with detailed error
messages when inputs are invalid.

7. Not Fully Responsive


Unless specifically styled, the layout may not adapt well to different screen sizes
(mobile, tablet, etc)

8
`

CODE

q <?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$temp = floatval($_POST['temperature']);
$conversion = $_POST['conversion'];
$convertedTemp = 0;

switch($conversion) {
case 'c_to_f':
$convertedTemp = ($temp * 9/5) + 32;
$result = "$temp °C = " . number_format($convertedTemp, 2) . "
°F";
break;
case 'f_to_c':
$convertedTemp = ($temp - 32) * 5/9;
$result = "$temp °F = " . number_format($convertedTemp, 2) . "
°C";
break;
case 'c_to_k':
$convertedTemp = $temp + 273.15;
$result = "$temp °C = " . number_format($convertedTemp, 2) . "
K";
break;
case 'k_to_c':
$convertedTemp = $temp - 273.15;
$result = "$temp K = " . number_format($convertedTemp, 2) . "
°C";
break;
case 'f_to_k':
$convertedTemp = ($temp - 32) * 5/9 + 273.15;
$result = "$temp °F = " . number_format($convertedTemp, 2) . "
K";
break;
case 'k_to_f':

9
`

$convertedTemp = ($temp - 273.15) * 9/5 + 32;


$result = "$temp K = " . number_format($convertedTemp, 2) . "
°F";
break;
default:
$result = "Invalid conversion.";
}
echo "<script>
setTimeout(function() {
let modal = document.getElementById('resultModal');
let modalText = document.getElementById('modalText');
let modalBtn = document.getElementById('modalBtn');
modalText.innerHTML = '$result';
modal.style.display = 'block';
modalBtn.focus();
}, 500);
</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<title>PHP Temperature Converter</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background:
url('https://source.unsplash.com/1600x900/?temperature,weather') no-
repeat center center/cover;
10
`

animation: fadeIn 1s ease-in-out;


}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

.container {
background: rgba(255, 255, 255, 0.95);
padding: 40px 30px;
border-radius: 15px;
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);
text-align: center;
max-width: 450px;
width: 100%;
animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
from { transform: translateY(-30px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}

h2 {
margin-bottom: 30px;
color: #333;
}

form {
display: flex;
flex-direction: column;
gap: 20px;
align-items: center;
}

11
`

input, select {
width: 100%;
padding: 14px 16px;
font-size: 18px;
border: 2px solid #ccc;
border-radius: 8px;
background-color: #f9f9f9;
transition: 0.3s ease;
}

input:focus, select:focus {
border-color: #28a745;
background-color: #fff;
}

button[type="submit"] {
padding: 14px 20px;
font-size: 18px;
border: none;
border-radius: 8px;
background: #28a745;
color: white;
cursor: pointer;
transition: background 0.3s ease;
width: 100%;
}

button[type="submit"]:hover {
background: #218838;
}

/* Modal Styles */
.modal {
display: none;
position: fixed;
12
`

z-index: 999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
background-color: white;
margin: 12% auto;
padding: 30px;
border: 1px solid #888;
width: 60%;
text-align: center;
border-radius: 12px;
animation: fadeIn 0.4s ease-in-out;
}
.modal-btn {
margin-top: 20px;
font-size: 18px;
padding: 10px 30px;
background: #007bff;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background 0.3s ease;
}
.modal-btn:hover {
background: #0069d9;
}
</style>
</head>
<body>
<div class="container">
13
`

<h2> Temperature Converter</h2>


<form method="post">
<input type="number" name="temperature" placeholder="Enter
Temperature" required>
<select name="conversion" required>
<option value="">Select Conversion</option>
<option value="c_to_f">Celsius to Fahrenheit</option>
<option value="f_to_c">Fahrenheit to Celsius</option>
<option value="c_to_k">Celsius to Kelvin</option>
<option value="k_to_c">Kelvin to Celsius</option>
<option value="f_to_k">Fahrenheit to Kelvin</option>
<option value="k_to_f">Kelvin to Fahrenheit</option>
</select>
<button type="submit">Convert </button>
</form>
</div>

<div id="resultModal" class="modal">


<div class="modal-content">
<p id="modalText"></p>
<button id="modalBtn" class="modal-btn"
onclick="closeModal()">OK</button>
</div>
</div>
<script>
function closeModal() {
document.getElementById('resultModal').style.display = 'none';
}
document.addEventListener('keydown', function(event) {
if (event.key === "Enter") {
closeModal();
}
});
</script>
</body>
</html>
14
`

OUTPUT

15
`

16
`

Conclusion

The Temperature Converter using PHP project successfully demonstrates how


basic web technologies—HTML and PHP—can be used together to create a
functional, user-friendly, and educational web application. Through this project, we
have learned how to accept user input via forms, process it using server-side logic,
and display accurate, real-time results back to the user.

Although the project is simple in scope, it effectively showcases important


programming concepts such as input validation, conditional logic, and dynamic web
page interaction. This converter also acts as a foundation for building more complex
applications, such as full-fledged unit converters, scientific tools, or IoT-enabled
systems.

In conclusion, this project not only fulfills its goal of converting temperatures
between Celsius, Fahrenheit, and Kelvin, but also provides a strong learning
platform for students looking to strengthen their skills in PHP and web development.

17

You might also like