0% found this document useful (0 votes)
35 views

PHP Report

The document describes a measurement conversion tool that allows users to easily convert between different units of measurement. It provides an overview of the tool's purpose and capabilities, as well as the technologies used such as PHP, HTML, CSS and how it benefits users.

Uploaded by

Suyash Kerkar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

PHP Report

The document describes a measurement conversion tool that allows users to easily convert between different units of measurement. It provides an overview of the tool's purpose and capabilities, as well as the technologies used such as PHP, HTML, CSS and how it benefits users.

Uploaded by

Suyash Kerkar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

A

Micro-Project Report
On

Measurement Conversion Tool


Submitted To
MSBTE
In Partial Fulfilment of Requirement of Diploma Of
Computer Engineering
Under I Scheme
Submitted By

Mr. Suyash Satish Kerkar


Mr. Manas Dattaram Desai
Ms. Manasvi Sanjay Parab
Ms. Shejal Angad Chandekar

Under the Guidance Of

Mr. R.C. Dhandekar

For Academic Year 2023-2024

Yashwantrao Bhonsale Institute Of Technology, Sawantwadi


MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION
CERTIFICATE
This is to certify that,

Mr. Suyash Satish Kerkar Roll No.01

Mr. Manas Dattaram Desai Roll No.04

Ms. Manasvi Sanjay Parab Roll No.09


Ms. Shejal Angad Chandekar Roll No.12

Of Sixth semester of diploma in Computer Engineering of institute


Yashwantrao Bhonsale Institute of Technology (1742) has completed the Micro
Project satisfactorily in subject Web Based Application Development Using PHP
(22619) for the academic year 2023 to 2024 as prescribed in the curriculum.

Subject Faculty HOD Principal

Seal of

Institution
INDEX

Sr. Topic Name Page


No. No.
1. Abstract 1

2. Introduction 1

3. Overview Of PHP 2-3

4. Technology Used 4

5. Program Code 5

6. Output 10

7. Conclusion 12

8. Reference 13
Department of Computer Engineering Measurement conversion

1.Abstract :-

The Measurement Conversion Tool is designed to cater to the diverse needs of users across various
disciplines by offering a comprehensive solution for converting measurements. Its intuitive interface
and precise algorithms make it an indispensable tool for professionals, students, and hobbyists alike.
Whether one is working on a scientific experiment, designing a building, or cooking a meal, the tool
streamlines the conversion process, saving time and effort. Additionally, its accessibility as a web-
based application ensures that users can access it from any device with an internet connection, further
enhancing its utility and convenience. Overall, the Measurement Conversion Tool is an invaluable
resource that simplifies the complexities of measurement conversion, empowering users to focus on
their tasks with confidence and efficiency.

2.Introduction :-

Measurement conversion is a fundamental aspect of various activities, ranging from scientific research
to everyday tasks like cooking and DIY projects. As our globalized world continues to connect people
from diverse backgrounds and cultures, the need for accurate and efficient measurement conversion
tools becomes increasingly important.
The Measurement Conversion Tool is developed with the aim of addressing this need by providing
users with a reliable and user-friendly platform for converting measurements across different units
and systems. Whether it's converting between metric and imperial units, calculating temperature
conversions, or determining volume and mass equivalents, this tool offers a comprehensive solution.
In today's fast-paced world, where time is often of the essence, having access to a tool that simplifies
complex measurement conversions can significantly enhance productivity and streamline workflows.
Whether you're a scientist conducting experiments, an engineer designing structures, or a chef
preparing recipes, the ability to quickly and accurately convert measurements is essential.
By providing an intuitive interface and leveraging advanced algorithms, the Measurement Conversion
Tool aims to empower users to perform measurement conversions with ease and precision.
Additionally, its accessibility as a web-based application means that users can access it anytime,
anywhere, from any device with an internet connection.
In summary, the Measurement Conversion Tool fills a crucial niche in the realm of measurement
conversion, offering a reliable and efficient solution for users across various industries and disciplines.

Yashwantrao Bhonsale Institute of Technology Page | 1


Department of Computer Engineering Measurement conversion

Its user-friendly interface, precise algorithms, and accessibility make it an indispensable tool for
anyone dealing with measurements on a regular basis.

3.Overview of PHP :-

PHP, which stands for Hypertext Preprocessor, is a widely-used open-source server-side scripting
language that is particularly well-suited for web development. Originally created by Danish-Canadian
programmer Rasmus Lerdorf in 1994, PHP has since evolved into a powerful and versatile language
used by millions of developers worldwide.

One of PHP's key strengths is its ability to generate dynamic web pages and interact with databases,
making it an ideal choice for developing interactive web applications like the Measurement
Conversion Tool. PHP scripts are embedded within HTML, allowing developers to seamlessly
integrate dynamic content and functionality into web pages.

Yashwantrao Bhonsale Institute of Technology Page | 2


Department of Computer Engineering Measurement conversion

PHP offers a wide range of features and capabilities, including:

1. Server-side scripting: PHP scripts are executed on the server, generating HTML content that is
then sent to the client's web browser. This allows for dynamic content generation and customization
based on user input or other factors.

2. Database integration: PHP supports integration with various database systems, including MySQL,
PostgreSQL, and SQLite, allowing developers to store and retrieve data from databases seamlessly.

3. Ease of use: PHP is known for its simplicity and ease of use, with a syntax that is similar to C and
Perl. This makes it accessible to developers of all skill levels, from beginners to experienced
professionals.

4. Extensive documentation and community support: PHP has a vast ecosystem of libraries,
frameworks, and resources, as well as comprehensive documentation and active community support.
This makes it easy for developers to find solutions to common problems and collaborate with others
in the PHP community.

5. Platform independence: PHP is platform-independent, meaning it can run on various operating


systems, including Linux, Windows, macOS, and Unix-like systems. This flexibility allows
developers to deploy PHP applications on a wide range of server environments.

Yashwantrao Bhonsale Institute of Technology Page | 3


Department of Computer Engineering Measurement conversion

4.Technology Used:-

1. HTML: HTML (Hypertext Markup Language) is the standard language for creating and
structuring web content. It uses tags to define elements such as headings, paragraphs, links,
and images. HTML provides the basic structure of a webpage and works in conjunction with
CSS and JavaScript to create a complete web experience.

2. CSS: CSS (Cascading Style Sheets) is a styling language used to enhance the visual
presentation of HTML documents. It enables the separation of content from design, allowing
developers to control layout, colors, fonts, and other stylistic aspects of a webpage. CSS
ensures a consistent and appealing look across different devices.

3. PHP: PHP, which stands for Hypertext Preprocessor, is a widely-used open-source server-
side scripting language that is particularly well-suited for web development. Originally
created by Danish-Canadian programmer Rasmus Lerdorf in 1994, PHP has since evolved
into a powerful and versatile language used by millions of developers worldwide

4. Visual Studio Code: Visual Studio Code is a popular, lightweight, and open-source code
editor developed by Microsoft. It supports various programming languages, including
HTML, CSS, and JavaScript. With features like syntax highlighting, debugging support, and
extensions, Visual Studio Code is widely used by developers for efficient code editing and
development.

5. Google Chrome: Google Chrome is a widely used web browser known for its speed,
simplicity, and performance. It supports the latest web technologies and developer tools,
making it a preferred choice for web developers. Chrome's Developer Tools provide features
for debugging, profiling, and analyzing web applications, making it an essential tool for
testing and optimizing web projects.

6. XAMPP server: XAMPP is a popular open-source cross-platform web server solution stack
package developed by Apache Friends. It includes Apache HTTP Server, MariaDB (a
MySQL database server), and interpreters for scripts written in PHP and Perl. Developers
often use XAMPP for local development and testing of web applications before deploying

Yashwantrao Bhonsale Institute of Technology Page | 4


Department of Computer Engineering Measurement conversion

them to a production server. The Measurement Conversion Tool may be developed and tested
locally using XAMPP to ensure compatibility and functionality before being deployed to a
live server environment.

5.Program Code: -
• Functions.php:

<?php

const LENGTH_TO_METER = array(


"inches" => 0.0254,
"feet" => 0.3048,
"yards" => 0.9144,
"miles" => 1609.344,
"millimeters" => 0.001,
"centimeters" => 0.01,
"meters" => 1,
"kilometers" => 1000,
"acres" => 63.614907234075,
"hectares" => 100,
"nautical_miles" => 1852
);

const VOLUME_TO_LITER = array(


"cubic_inches" => 0.0163871,
"cubic_feet" => 28.3168,
"cubic_centimeters" => 0.001,
"cubic_meters" => 1000,
"imperial_gallons" => 4.54609,
"imperial_quarts" => 1.13652,
"imperial_pints" => 0.568261,
"imperial_cups" => 0.284131,
"imperial_ounces" => 0.0284131,
"imperial_tablespoons" => 0.0177582,
"imperial_teaspoons" => 0.00591939,
"us_gallons" => 3.78541,
"us_quarts" => 0.946353,
"us_pints" => 0.473176,
"us_cups" => 0.24,
"us_ounces" => 0.0295735,
"us_tablespoons" => 0.0147868,
"us_teaspoons" => 0.00492892,
"liters" => 1,
"milliliters" => 0.001,

Yashwantrao Bhonsale Institute of Technology Page | 5


Department of Computer Engineering Measurement conversion

);

const MASS_TO_KILOGRAM = array(


"ounces" => 0.0283495,
"pounds" => 0.453592,
"stones" => 6.35029,
"long_tons" => 1016.05,
"short_tons" => 907.185,
"milligrams" => 0.000001,
"grams" => 0.001,
"kilograms" => 1,
"metric_tonnes" => 1000
);

function optionize($string) {
return str_replace(' ', '_', strtolower($string));
}

function float_to_string($float, $precision=10) {


$float = (float) $float;
$string = number_format($float, $precision, '.', '');
$string = rtrim($string, '0');
$string = rtrim($string, '.');
return $string;
}

// Length
function convert_to_meters($value, $from_unit) {
if(array_key_exists($from_unit, LENGTH_TO_METER)) {
return $value * LENGTH_TO_METER[$from_unit];
} else {
return "Unsupported unit.";
}
}

function convert_from_meters($value, $to_unit) {


if(array_key_exists($to_unit, LENGTH_TO_METER)) {
return $value / LENGTH_TO_METER[$to_unit];
} else {
return "Unsupported unit.";
}
}

function convert_length($value, $from_unit, $to_unit) {


$meter_value = convert_to_meters($value, $from_unit);
$new_value = convert_from_meters($meter_value, $to_unit);
return $new_value;
}

Yashwantrao Bhonsale Institute of Technology Page | 6


Department of Computer Engineering Measurement conversion

// Area
function convert_to_square_meters($value, $from_unit) {
$from_unit = str_replace('square_', '', $from_unit);
if(array_key_exists($from_unit, LENGTH_TO_METER)) {
return $value * pow(LENGTH_TO_METER[$from_unit], 2);
} else {
return "Unsupported unit.";
}
}

function convert_from_square_meters($value, $to_unit) {


$to_unit = str_replace('square_', '', $to_unit);
if(array_key_exists($to_unit, LENGTH_TO_METER)) {
return $value / pow(LENGTH_TO_METER[$to_unit], 2);
} else {
return "Unsupported unit.";
}
}

function convert_area($value, $from_unit, $to_unit) {


$meter_value = convert_to_square_meters($value, $from_unit);
$new_value = convert_from_square_meters($meter_value, $to_unit);
return $new_value;
}

// Volume
function convert_to_liters($value, $from_unit) {
if(array_key_exists($from_unit, VOLUME_TO_LITER)) {
return $value * VOLUME_TO_LITER[$from_unit];
} else {
return "Unsupported unit.";
}
}

function convert_from_liters($value, $to_unit) {


if(array_key_exists($to_unit, VOLUME_TO_LITER)) {
return $value / VOLUME_TO_LITER[$to_unit];
} else {
return "Unsupported unit.";
}
}

function convert_volume($value, $from_unit, $to_unit) {


$liter_value = convert_to_liters($value, $from_unit);
$new_value = convert_from_liters($liter_value, $to_unit);
return $new_value;
}

Yashwantrao Bhonsale Institute of Technology Page | 7


Department of Computer Engineering Measurement conversion

// Mass
function convert_to_kilograms($value, $from_unit) {
if(array_key_exists($from_unit, MASS_TO_KILOGRAM)) {
return $value * MASS_TO_KILOGRAM[$from_unit];
} else {
return "Unsupported unit.";
}
}

function convert_from_kilograms($value, $to_unit) {


if(array_key_exists($to_unit, MASS_TO_KILOGRAM)) {
return $value / MASS_TO_KILOGRAM[$to_unit];
} else {
return "Unsupported unit.";
}
}

function convert_mass($value, $from_unit, $to_unit) {


$kg_value = convert_to_kilograms($value, $from_unit);
$new_value = convert_from_kilograms($kg_value, $to_unit);
return $new_value;
}

// Speed
function convert_speed($value, $from_unit, $to_unit) {
if($from_unit == 'knots') { $from_unit = 'nautical_miles_per_hour'; }
if($to_unit == 'knots') { $to_unit = 'nautical_miles_per_hour'; }

list($from_dist, $from_time) = explode('_per_', $from_unit);


list($to_dist, $to_time) = explode('_per_', $to_unit);

if($from_time == 'hour') { $value /= 3600; }


$value = convert_length($value, $from_dist, $to_dist);
if($to_time == 'hour') { $value *= 3600; }

return $value;
}

// Temperature
function convert_to_celsius($value, $from_unit) {
switch($from_unit) {
case 'celsius':
return $value;
break;
case 'fahrenheit':
return ($value - 32) / 1.8;
break;
case 'kelvin':
return $value - 273.15;
break;

Yashwantrao Bhonsale Institute of Technology Page | 8


Department of Computer Engineering Measurement conversion

default:
return "Unsupported unit.";
}
}

function convert_from_celsius($value, $to_unit) {


switch($to_unit) {
case 'celsius':
return $value;
break;
case 'fahrenheit':
return ($value * 1.8) + 32;
break;
case 'kelvin':
return $value + 273.15;
break;
default:
return "Unsupported unit.";
}
}

function convert_temperature($value, $from_unit, $to_unit) {


$celsius_value = convert_to_celsius($value, $from_unit);
$new_value = convert_from_celsius($celsius_value, $to_unit);
return $new_value;
}

?>

Yashwantrao Bhonsale Institute of Technology Page | 9


Department of Computer Engineering Measurement conversion

7.Output:-

Figure 1 Home Menu

Figure 2 Length Conversion

Yashwantrao Bhonsale Institute of Technology Page | 10


Department of Computer Engineering Measurement conversion

Figure 3 Area Conversion

Figure 4 Volume Conversion

Yashwantrao Bhonsale Institute of Technology Page | 11


Department of Computer Engineering Measurement conversion

8.Conclusion:-

The Measurement Conversion Tool represents a significant advancement in simplifying the often
complex and tedious task of converting measurements across various units and systems. By leveraging
a combination of PHP, HTML/CSS, JavaScript, MySQL, APIs, and responsive design techniques, the
tool offers users a seamless and efficient experience for performing conversions.
With its intuitive interface, accurate conversion algorithms, and accessibility across different devices,
the Measurement Conversion Tool serves as a valuable resource for professionals, students, and
enthusiasts across diverse fields. Whether it's converting between metric and imperial units, calculating
temperature conversions, or determining volume and mass equivalents, the tool provides users with
the necessary tools to accomplish their tasks with ease and precision.
Furthermore, the integration of XAMPP server for local development ensures that the tool can be
thoroughly tested and refined before deployment to a live server environment, thereby guaranteeing
compatibility and functionality.
In conclusion, the Measurement Conversion Tool stands as a testament to the power of technology in
simplifying complex tasks and enhancing productivity. By streamlining the conversion process and
providing users with a user-friendly interface, the tool empowers individuals to focus on their work
with confidence and efficiency. As technology continues to evolve, the Measurement Conversion Tool
remains a reliable and indispensable resource for users worldwide.

Yashwantrao Bhonsale Institute of Technology Page | 12


Department of Computer Engineering Measurement conversion

9.References:-

1. W3Schools:
• W3Schools JavaScript Tutorial
• W3Schools HTML Tutorial
• W3Schools CSS Tutorial
• W3Schools PHP Tutorial
2. Visual Studio Code Documentation:
• Visual Studio Code Documentation

3. Google Chrome Developer Documentation:


• Google Chrome DevTools Documentation
4. Paper Links:
• https://openurl.ebsco.com/EPDB%3Agcd%3A16%3A3282592/detailv2?sid=ebsco%3
Aplink%3Ascholar&id=ebsco%3Agcd%3A124636585&crl=c
• https://openarchive.nure.ua/entities/publication/d32fc946-4bb2-4ad9-bce3-
aac5f376b4eb
• https://www.sciencedirect.com/science/article/abs/pii/S0950584915002062

• Books used:

Yashwantrao Bhonsale Institute of Technology Page | 13

You might also like