Advertisement
whyisjake

Untitled

Jul 6th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php if (!$_POST) { ?>
  2.        
  3.         <form action="" method="post">
  4.         Zip Code:  <input type="text" name="zip" /><br />
  5.         <input type="submit" name="submit" value="Submit me!" />
  6.         </form>
  7.         <?php }  ?>
  8.        
  9.         <?php
  10.        
  11.         error_reporting(E_ALL);
  12.        
  13.         if ($_POST) {
  14.             $request_url = 'http://www.google.com/ig/api?weather='.urlencode($_POST['zip']);
  15.             $xml = simplexml_load_file($request_url) or die("feed not loading");
  16.             echo 'Jake was here...';
  17.             var_dump($xml);
  18.             echo $xml->weather[0]->forecast_information[0]->city[0]->data[0];
  19.             echo 'What about now?';
  20.         }
  21.        
  22.        
  23.        
  24.        
  25.         ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement