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

Maharashtra State Board of Technical Education Bijapure Mohammad Afraz Sarfaraz Nawaz Mrs. B.S.Mali

The document is a project report on developing a currency converter using PHP. It includes an introduction to PHP and its features, a literature review on relevant topics, and outlines of the project including the rationale, aims, and course outcomes. The report will document the process of creating a currency converter application to practice PHP programming skills.

Uploaded by

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

Maharashtra State Board of Technical Education Bijapure Mohammad Afraz Sarfaraz Nawaz Mrs. B.S.Mali

The document is a project report on developing a currency converter using PHP. It includes an introduction to PHP and its features, a literature review on relevant topics, and outlines of the project including the rationale, aims, and course outcomes. The report will document the process of creating a currency converter application to practice PHP programming skills.

Uploaded by

52krxbhp9p
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

A

Project Report On
“Currency Converter using PHP”
Submitted in Partial Fulfillment of the Requirement
For the Award of Diploma
In “Computer Science and Engineering” of
Government Polytechnic College, Dharashiv
Affiliated to

Maharashtra State Board of Technical Education


Submitted by
Bijapure Mohammad Afraz Sarfaraz Nawaz
Under the Guidance of
Mrs. B.S.Mali

Department of Computer Science and Engineering,


Government Polytechnic College, Dharashiv
MAHARASHTRA STATE BOARD
OF TECHNICAL EDUCATION
MUMBAI

CERTIFICATE

This is certify that Mr. Bijapure Mohammad Afraz Sarfaraz Nawaz Roll no. 63 of
sixth Semester of Diploma in Computer Engineering of Institute Government
Polytechnic, Dharashiv (0118) has completed the Micro-project satisfactory in
subject PHP (22619) for the academic year 2023-2024 as prescribed in the
curriculum.

Place : Dharashiv Enrollment no : 2101180252


Date : Exam Seat no :

Subject Teacher Head of Department Principal

Seal of Institute
ACKNOWLEDGEMENT

I am sincerely grateful for the guidance and support provided by Mrs. Mali Mam
throughout the development of the Currency Converter project. This project has
offered me a wealth of knowledge and insight of intricacies of developing a
comprehensive software. I extend my heartfelt appreciation for this incredible
opportunity.

I would also like to extend my gratitude to my friends for their unwavering support
and assistance in successfully completing this project within the specified time
constraints.

The process of working on this project has been instrumental in my professional


growth, And I am deeply thankful to Mrs. Mali Mam for fostering my understanding
of the subject matter. Her mentorship has played a pivotal role in enhancing my skills
and knowledge in the domian.

I express my heartfelt gratitude once again for invaluable guidance and support
provided throughout the endeavour.

Sincerely,
Bijapure Afraz
INDEX

Sr.No Title Page.no


1 Rationale 5-5
2 Aim Of Microproject 5-5
3 Course Outcome Achieved 5-5
4 Literature Review 6-6
5 Introduction 7-9
6 Actual Methodology Followed 10-14
7 Output 15-16
8 Actual Resources Used 17-17
9 Skills Developed 17-17
10 Applications 17-17
12 Conclusion 18-18
13 References 18-18
1.0 Rationale:

The rationale for undertaking a micro project on creating a currency converter in PHP lies in its
practical utility and educational value. In an increasingly interconnected world, where businesses
and individuals engage in transactions across borders, having a tool to swiftly convert currencies is
invaluable. By developing this project, I aim to hone my PHP programming skills, particularly in
handling user inputs, implementing mathematical algorithms for currency conversion, and
presenting results in a user-friendly interface. Additionally, this project offers an opportunity to
deepen my understanding of web development principles, including data validation, and responsive
design. Ultimately, the currency converter project serves as a tangible application of PHP
programming concepts while addressing a real-world need, facilitating financial transactions and
enhancing my proficiency in web development.

2.0 Aim/Benefits of micro-project:

The aim of this micro-project is to develop a currecy converter using PHP

Benefits:
• Practical Utility
• Learning Experience
• Skill Enhancement
• Exploration of Advanced Features

3.0 Course Outcomes:

i. Understand Basic PHP concepts.


ii. Utilize External APIs
iii. Implement Currency Conversion Logic
iv. Handle Form Submission

5
4.0 Literature Review:

The creation of currency converters using PHP is a common application of web development
technologies, facilitating seamless currency exchange processes for users across the globe. This
literature review aims to explore key aspects relevant to the development of PHP-based currency
converters, including currency conversion algorithms, web development best practices, API
integration, user interface design, and security considerations.

• Currency Conversion Algorithms:


• Literature extensively covers various algorithms and techniques for currency
conversion. These include fixed rate conversions, real-time exchange rates retrieval
from APIs, and historical data analysis for forecasting. Resources such as academic
papers and financial textbooks provide insights into the mathematical principles
behind these algorithms.

• PHP Programming and Web Development:
• In the realm of PHP programming and web development, literature offers guidance
on syntax, data handling, and user interface design. Topics covered include PHP
frameworks, libraries, and methodologies for building efficient and secure web
applications.

• API Integration for Exchange Rate Data:
• Integration of APIs to retrieve real-time exchange rate data is a crucial aspect of PHP
currency converters. Literature explores various exchange rate APIs, their
functionalities, and implementation strategies. Additionally, research papers and
documentation provide insights into handling API requests, error handling, and data
parsing.

• User Interface Design and User Experience (UX):
• Literature emphasizes the significance of user-centric design in currency converter
applications. Studies discuss UX principles, responsive design techniques, and
accessibility considerations for creating intuitive and visually appealing interfaces.
Examples of best practices and case studies offer practical insights into designing
effective user experiences.

In summary, the literature review highlights the multifaceted nature of PHP currency converter
development, encompassing technical, design, and security aspects. By drawing from existing
knowledge and best practices, developers can create robust and user-friendly currency converter
applications that meet the needs of a global audience while ensuring data integrity and security.

6
INTRODUCTION

Introduction to PHP:

PHP, which stands for Hypertext Preprocessor, is a widely-used open-source scripting language
primarily designed for web development. Originally created by Danish-Canadian programmer
Rasmus Lerdorf in 1994, PHP has evolved into one of the most popular server-side scripting
languages for creating dynamic and interactive web pages.

Key Features of PHP:

• Server-Side Scripting: PHP is executed on the server-side, meaning it runs on the web
server before the resulting HTML is sent to the client's web browser. This enables PHP to
generate dynamic content, interact with databases, and perform various server-side tasks.

• Embedded in HTML: PHP code can be seamlessly embedded within HTML, allowing
developers to mix PHP with standard HTML markup. This facilitates the creation of
dynamic web pages by enabling the integration of PHP scripts with HTML for generating
dynamic content.

• Cross-Platform Compatibility: PHP is compatible with major operating systems such as
Windows, Linux, macOS, and various web servers like Apache, Nginx, and Microsoft IIS.
This cross-platform compatibility ensures that PHP applications can run on a wide range of
environments.

• Extensive Library Support: PHP has a vast ecosystem of libraries, frameworks, and
extensions that extend its functionality and streamline web development. Popular PHP
frameworks such as Laravel, Symfony, and CodeIgniter provide pre-built components and
tools for building robust web applications efficiently.

• Database Integration: PHP offers seamless integration with databases, allowing developers
to interact with relational databases like MySQL, PostgreSQL, and SQLite. This enables the
creation of dynamic web applications with features such as user authentication, content
management, and e-commerce functionality.

7
Common Use Cases of PHP:

• Dynamic Web Pages: PHP is commonly used to create dynamic web pages that generate
content based on user inputs, database queries, or external data sources. This enables the
creation of interactive websites with features such as user authentication, form processing,
and content management systems.

• Web Application Development: PHP is widely used for developing web applications
ranging from simple blogs and e-commerce platforms to complex enterprise applications. Its
versatility, scalability, and extensive library support make it a popular choice for building a
wide range of web-based solutions.

• API Development: PHP can be used to create APIs (Application Programming Interfaces)
for building RESTful web services and integrating with external applications or services.
APIs developed in PHP enable communication between different software systems,
facilitating data exchange and interoperability.

Introduction to Currency Converter using PHP:

Currency conversion is a common necessity in today's globalized world, where individuals and
businesses frequently engage in international transactions. A currency converter is a valuable tool
that allows users to convert the value of one currency into another based on prevailing exchange
rates. In this context, PHP provides an efficient and versatile platform for creating currency
converter applications that can be seamlessly integrated into websites or web applications.

Key Components of a PHP Currency Converter:

• User Interface: The currency converter interface typically consists of input fields for
specifying the amount to be converted, dropdown menus for selecting the source and target
currencies, and a button to initiate the conversion process. PHP is used to generate dynamic
HTML content and handle user interactions on the server-side.

• Exchange Rate Retrieval: PHP facilitates the retrieval of exchange rate data from external
sources such as currency exchange rate APIs. These APIs provide real-time or historical
exchange rate information for different currency pairs, enabling accurate currency
conversion calculations within the PHP application.

8
• Currency Conversion Algorithm: PHP implements the logic for performing currency
conversion calculations based on the input amount and retrieved exchange rates. This
involves multiplying the input amount by the exchange rate of the selected target currency
relative to the source currency to determine the converted amount.

• Error Handling: PHP code incorporates error handling mechanisms to gracefully manage
scenarios such as invalid user inputs, API request failures, or unexpected errors during
currency conversion. Error messages are displayed to users to provide feedback and guide
them in correcting input errors or resolving issues.

• Output Display: Upon successful currency conversion, PHP generates HTML output to
display the converted amount along with relevant currency symbols and labels. The
converted amount is presented to users in a clear and understandable format, ensuring a
seamless user experience.

In summary, a currency converter using PHP provides a practical and effective solution for
facilitating currency conversion tasks within web-based applications. With its robust features,
flexibility, and extensive community support, PHP empowers developers to create reliable and user-
friendly currency converter applications that meet the needs of users in today's interconnected
global economy.

9
5.0 Actual Methodology Followed:

Code:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<title>Currency Converter</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-image: url('blue-curve-
background_53876-113112.jpg.avif');
background-size: cover;
background-repeat: no-repeat;
}

.converter {
width: 80%; /* Set a percentage value */
max-width: 400px;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #f9f9f9;
}

h2 {
text-align: center;
margin-bottom: 20px;
}

input[type="number"] {
display: block;
width: calc(100% - 20px); /* Adjusted width */
margin-bottom: 10px;
10
padding: 10px;
box-sizing: border-box; /* Include padding in the
width calculation */
}

input[type="number"]::placeholder {
font-size: 0.8em; /* Adjusted font size for the
placeholder */
}

input[type="number"]:focus {
outline: none; /* Remove default focus style */
}

select, button {
display: block;
width: 100%;
margin-bottom: 10px;
padding: 10px;
}

button {
background-color: #007bff;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}

button:hover {
background-color: #0056b3;
}

.result {
text-align: center;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="converter">
<h2>Currency Converter</h2>

11
<form action="<?php echo
htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="POST">
<input type="number" name="amount"
placeholder="Amount" step="any" required>
<select name="from_currency" required>
<option value="USD">USD</option>
<option value="EUR">EUR</option>
<option value="GBP">GBP</option>
<option value="AUD">AUD</option>
<option value="CAD">CAD</option>
<option value="JPY">JPY</option>
<option value="CHF">CHF</option>
<option value="CNY">CNY</option>
<option value="INR">INR</option>
<option value="SGD">SGD</option>
<option value="HKD">HKD</option>
<option value="NZD">NZD</option>
<option value="MXN">MXN</option>
<option value="BRL">BRL</option>
<option value="SAR">SAR</option>
<option value="AED">AED</option>
<option value="KRW">KRW</option>
<option value="THB">THB</option>
<option value="RUB">RUB</option>
<option value="TRY">TRY</option>
<option value="IDR">IDR</option>
<option value="PHP">PHP</option>
<option value="ZAR">ZAR</option>
<option value="PLN">PLN</option>
<option value="SEK">SEK</option>
<option value="NOK">NOK</option>
<option value="DKK">DKK</option>
<option value="HUF">HUF</option>
<option value="CZK">CZK</option>
<option value="ILS">ILS</option>
<option value="ISK">ISK</option>
<option value="MYR">MYR</option>
<option value="RON">RON</option>
<option value="HRK">HRK</option>
<option value="KWD">KWD</option>
</select>
<select name="to_currency" required>

12
<option value="USD">USD</option>
<option value="EUR">EUR</option>
<option value="GBP">GBP</option>
<option value="AUD">AUD</option>
<option value="CAD">CAD</option>
<option value="JPY">JPY</option>
<option value="CHF">CHF</option>
<option value="CNY">CNY</option>
<option value="INR">INR</option>
<option value="SGD">SGD</option>
<option value="HKD">HKD</option>
<option value="NZD">NZD</option>
<option value="MXN">MXN</option>
<option value="BRL">BRL</option>
<option value="SAR">SAR</option>
<option value="AED">AED</option>
<option value="KRW">KRW</option>
<option value="THB">THB</option>
<option value="RUB">RUB</option>
<option value="TRY">TRY</option>
<option value="IDR">IDR</option>
<option value="PHP">PHP</option>
<option value="ZAR">ZAR</option>
<option value="PLN">PLN</option>
<option value="SEK">SEK</option>
<option value="NOK">NOK</option>
<option value="DKK">DKK</option>
<option value="HUF">HUF</option>
<option value="CZK">CZK</option>
<option value="ILS">ILS</option>
<option value="ISK">ISK</option>
<option value="MYR">MYR</option>
<option value="RON">RON</option>
<option value="HRK">HRK</option>
<option value="KWD">KWD</option>
</select>
<button type="submit">Convert</button>
</form>
<?php

13
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$amount = $_POST['amount'];
$from_currency = $_POST['from_currency'];
$to_currency = $_POST['to_currency'];

$base_url = "https://api.exchangerate-api.com/v4/
latest/{$from_currency}";

$response = file_get_contents($base_url);
$data = json_decode($response, true);

if ($data['error']) {
echo "Error: {$data['error']}";
exit();
}

$exchange_rate = $data['rates'][$to_currency];
$converted_amount = $amount * $exchange_rate;

echo "<div class='result'>{$amount} {$from_currency} =


{$converted_amount} {$to_currency}</div>";
}
?>
</div>
</body>
</html>

14
Output of code:

Image 1 : Opening Currency converter

Image 2 : Choosing the currencies

15
Image 3 : Choosing amount

Image 4 : Converted amount

16
6.0 Actual Resources Used :

Sr.No. Name of Resources Broad Specification Quantity


1 Computer Intel i5 Quad Core 8 GB 1
RAM

2 Operating System MacOS Sonoma 1


3 Software Apple Pages 1
4 Other Resources XAMPP, VS Code 1

7.0 Skills Developed :

i. PHP Programming
ii. API Integration
iii. Error Handling
iv. HTML/CSS

8.0 Applications :

i. E-commerce websites
ii. Mobile Apps
iii. Global freelancing
iv. Global Marketing

17
Conclusion :

In conclusion, creating a currency converter micro project using PHP has been a valuable learning
experience. Through this project, we have gained hands-on experience in PHP programming, API
integration, data handling, and user interface design. We have learned how to fetch real-time
exchange rates from external sources, perform currency conversions, and display results in a user-
friendly manner. This project has also helped us improve our problem-solving skills, as we
encountered various challenges such as error handling, security considerations, and performance
optimization.

References :

i. openai.com
ii. php.net
iii. github.com
iv. exchangerate-api.com

18

You might also like