Posted By

orenus on 06/30/10


Tagged

form php oop getweather Lesson2


Versions (?)

Get Weather - Step 1 - Simple HTML Form...


 / Published in: PHP
 

  1. <html>
  2. <form method="post" action="MyWeather.php">
  3. <input type="text" name="city">
  4. <input type="submit" value="go!">
  5. </form>
  6. </html>
  7.  
  8.  
  9. <?php
  10.  
  11. $city=$_POST['city'];
  12.  
  13. if ($city != ""){
  14.  
  15. $res = shell_exec("./getWdr.sh {$city}");
  16.  
  17. echo "Weather in {$city}: [high,low] ". $res;
  18. }
  19. else
  20. echo "no city...";
  21.  
  22.  
  23. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Vordreller on June 30, 2010

Linux only, it seems.

You need to login to post a comment.