PHP Final 1.1
PHP Final 1.1
MICRO-PROJECT REPORT ON
“WEATHER FORECAST”
FOR THE DIPLOMA IN COMPUTER ENGINEERING
SUBMITTED BY
BARGAL PAYAL BALKRISHNA
CHAVAN HARSHADA VIJAY
GARUDE PRAJAKTI PARMOD
UNDER THE GUIDANCE OF
Mrs. P. V. POLSHETWAR
DEPARTMENT OF COMPUTER ENGINEERING CSMSS
COLLEGE OF POLYTECHNIC, CHH.SAMBHAJINAGAR
MAHARASHTRA, INDIA
MICRO-PROJECT REPORT ON
“WEATHER FORECAST”
SUBMITTED BY
COLLEGE OF POLYTECHNIC
CERTIFICATE
This is to certify that Ms. PAYAL BALKRISHNA BARGAL, Ms. HARSHADA VIJAY
CHAVAN, Ms. PRAJAKTI PRAMOD GARUDE from (Institute) CSMSS College of
Polytechnic having Enrollment No. 2111520038, 2111520047, 2111520058 have Completed
Micro-Project of third year (5th Sem) having title “Weather Forecast” during academic year
2023-24. The Micro- project completed by individually / in a group consisting of 03 Candidates
under the guidance of the faculty guide.
Principal
Acknowledgement
We would like to express our thanks to the people who have helped us most throughout our project.
We would like to express our sincere thanks to the principal of CSMSS College of Polytechnic Dr.
GANESH. B. DONGRE for being always with us as a motivator. We are thankful to the H.O.D.
Of Computer Department Ms. R. S. POPHALE for her kind support. We are grateful to our Project
guide Mrs. P. V. POLSHETWAR or continuous support and motivation for the project. Her help
made us possible to complete our project with all the accurate information. A special thanks of our
goes to our friends who helped us in completing the project, where they all exchanged their own
interesting ideas. We wish to thank our parents for their personal support or attention who inspired
us to go our own way. Finally, we would like to thank God who made all things possible for us till
the end.
3. RATIONALE .................................................................................................... 4
Undoubtedly, weather forecasting has come a long way, helping people to know
about weather conditions. So, if you are in an area where weather frequently changes
from sunny to torrential rain in a matter of minutes, then what is the easiest way to
make sure to be prepared for A suitable answer is a weather application.
1|Page
3.0 PROPOSED METHODOLOGY:
Name of
Sr. Planned Planned Responsible
No. Details of Activities Start Date Finish Team
Date Member
2|Page
5.0 RESOURCES REQUIRED:
Sr. Name of Resource/Material
No. Specification Qty Remarks
i-5,4 GB RAM
1 Laptop 1
2 https://www.planettogether.com/blog/the- Website -
importance-ofsupply-chain-management
Ms. P. V. POLSHETWAR
DEPARTMENT OF COMPUTER ENGINEERING
3|Page
RATIONALE
PHP is a general purpose, server-side scripting language run a web server that’s designed to
make dynamic pages and applications. PHP as a web development option is secure, fast and
reliable. In the growing field of Web technology, it is essential for every Diploma pass outs to
learn PHP Language to help them build interactive web applications. This course is designed
to inculcate web based applications development skills in students using server side scripting
with PHP.
4|Page
LITERATURE REVIEW
Introduction
The term PHP is an acronym for – Hypertext Preprocessor. PHP is a server-side scripting
language designed specifically for web development. It is open-source which means it is free
to download and use. It is very simple to learn and use. The file extension of PHP is “.php”.
PHP was introduced by Rasmus Lerdorf in the first version and participated in the later
versions. It is an interpreted language and it does not require a compiler.
Characteristics of PHP
What is an API?
APIs are mechanisms that enable two software components to communicate with each other
using a set of definitions and protocols. For example, the weather bureau’s software system
contains daily weather data. The weather app on your phone “talks” to this system via APIs
and shows you daily weather updates on your phone.
The working of an API can be clearly explained with a few simple steps. Think of a client-
server architecture where the client sends the request via a medium to the server and receives
the response through the same medium. An API acts as a communication medium between
two programs or systems for functioning. The client is the user/customer (who sends the
request), the medium is the application interface programming, and the server is the
backend (where the request is accepted and a response is provided). Steps followed in the
working of APIs –
5|Page
• The client initiates the requests via the APIs URI (Uniform Resource Identifier)
• The API makes a call to the server after receiving the request
• Then the server sends the response back to the API with the information
• Finally, the API transfers the data to the client
APIs are considered safe in terms of attacks as it includes authorization credentials and an
API gateway to limit access so as to minimize security threats. To provide additional security
layers to the data, HTTP headers, query string parameters, or cookies are used. So in the
weather example, the bureau’s weather database is the server, and the mobile app is the client.
Types of Requests or Request Methods characterize what action we are going to take by calling
the API.
•GET: retrieve information (like product information). This is the most common type of
request. By using it, we can get the data we are interested in from API.
•POST: adds new data to the server. By using this type of request you can, for example, add a
new review of a hotel.
•PUT: changes existing information. For example, by using this type of request, it would be
possible to change the text and publication date in an existing blog post.
6|Page
WEATHER FORECAST
Code:
<?php
$status="";
$msg="";
$city="";
if(isset($_POST['submit'])){
$city=$_POST['city'];
$url="http://api.openweathermap.org/data/2.5/weather?q=$city&appid=ce0253a4a31a854ffcfe4cfede
e6bfb4";
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$result=curl_exec($ch);
curl_close($ch);
$result=json_decode($result,true);
if($result['cod']==200){
$status="yes";
}else{
$msg=$result['message'];
}
}
?>
8|Page
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
justify-content: center;
margin-left:-15px;
}
.widget .weatherInfo .description .weatherCondition {
text-transform: uppercase;
font-size: 35px;
font-weight: 100;
}
.widget .weatherInfo .description .place {
font-size: 15px;
}
.widget .date {
flex: 0 0 30%;
height: 40%;
background: #70C1B3;
border-bottom-right-radius: 20px;
display: flex;
justify-content: space-around;
align-items: center;
color: white;
font-size: 30px;
font-weight: 800;
}
p{
position: fixed;
bottom: 0%;
right: 2%;
}
pa{
text-decoration: none;
color: #E4D6A7;
font-size: 10px;
}
.form{
position: absolute;
top: 42%;
left: 50%;
display: flex;
9|Page
height: 300px;
width: 600px;
transform: translate(-50%, -50%);
}
.text{
width: 80%;
padding: 10px
}
.submit{
height: 39px;
width: 100px;
border: 0px;
}
.mr45{
margin-right:45px;
}
</style>
</head>
<body>
<div class="form">
<form style="width:100%;" method="post">
<input type="text" class="text" placeholder="Enter city name" name="city" value="<?php echo
$city?>"/>
<input type="submit" value="Submit" class="submit" name="submit"/>
<?php echo $msg?>
</form>
</div>
<?php if($status=="yes"){?>
<article class="widget">
<div class="weatherIcon">
<img src="http://openweathermap.org/img/wn/<?php echo
$result['weather'][0]['icon']?>@4x.png"/>
</div>
<div class="weatherInfo">
<div class="temperature">
<span><?php echo round($result['main']['temp']-273.15)?>°</span>
</div>
<div class="description mr45">
10 | P a g e
<div class="weatherCondition"><?php echo $result['weather'][0]['main']?></div>
<div class="place"><?php echo $result['name']?></div>
</div>
<div class="description">
<div class="weatherCondition">Wind</div>
<div class="place"><?php echo $result['wind']['speed']?> M/H</div>
</div>
</div>
<div class="date">
<?php echo date('d M',$result['dt'])?>
</div>
</article>
<?php } ?>
</body>
</html>
11 | P a g e
5.0Actual Methodology Followed
A)- Project Topic selection:
At the beginning we were confused about selecting Topic for PHP Subject
microproject but after a conversation with subject teacher we made my decision
and select topic Weather Viewer App.
After selecting project topic then we searched lots of information related to test
cases.we was visited more than 5 websites which gave me valuable information
about my Project topic.
As we was not able to proceed further in micro project we did brief discussion with
respected subject teacher (Prof. ) ,During conversation Mam gave me
proper instruction and Sequence for project.
After removing errors, we had completed my project and got the proper output.
12 | P a g e
6.0 Actual Resources Used
information
13 | P a g e
7.0 Outputs of the micro
Micro project (information) is attached below
14 | P a g e
Page | 15
8.0 Skill Developed/Learning outcome of this micro project
Page | 16
9.0 Applications of this micro project: -
Page | 17
CONCLUSION
In short, while PHP can be used for developing weather forecasting applications, its
suitability depends on the complexity of the project. While PHP is proficient for web
development and data handling, it may lack the computational efficiency needed for
advanced weather prediction algorithms. However, by leveraging APIs and libraries, PHP
can still be effective for simpler forecasting tasks or integrated within larger software
systems. Combining PHP with other languages optimized for heavy computation, and the
perfect accuracy and performance of weather forecasting applications.
Page | 18