Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if (!$_POST) { ?>
- <form action="" method="post">
- Zip Code: <input type="text" name="zip" /><br />
- <input type="submit" name="submit" value="Submit me!" />
- </form>
- <?php } ?>
- <?php
- error_reporting(E_ALL);
- if ($_POST) {
- $request_url = 'http://www.google.com/ig/api?weather='.urlencode($_POST['zip']);
- $xml = simplexml_load_file($request_url) or die("feed not loading");
- echo 'Jake was here...';
- var_dump($xml);
- echo $xml->weather[0]->forecast_information[0]->city[0]->data[0];
- echo 'What about now?';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement