PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Amit Yadav  >  Google Weather  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Google Weather
Retrieve weather forecast for a city from Google
Author: By
Last change:
Date: 10 years ago
Size: 659 bytes


Class file image Download
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
$selectedCity = (isset($_POST["city"]) && $_POST["city"] != "")?$_POST["city"]:"Pune";

$googleWeather = new googleweather($selectedCity);

<form method="post" name="weather">
    <select name="city" onChange="weather.submit();">
foreach($googleWeather->cities as $city){
<option value="<?php echo $city;?>" <?php echo ($selectedCity == $city)?"selected":"";?>><?php echo $city;?></option>


For more information send a message to info at phpclasses dot org.