PHP 308
Naths By Guest on 15th December 2016 04:07:24 AM
  1. <?php  // 2016_10_14 naths v 1.1 ;)
  2.  
  3. /* I made this "home made cookies" script to be used with temperature to Ethernet sensor:
  4. https://www.papouch.com/en/shop/product/tme-ip-ethernet-thermometer/ (Firmware version: 2.06)
  5. From the web interface of your Thermometer go to "Settings" --TAB--> "Sending"
  6. There set
  7. -- "WEB server's address" like "example.com"
  8. -- "Sending interval" - I user 1 here for refresh every minute
  9. -- check "Enable HTTP GET sending" checkbox
  10. -- "Script name" -> the php filename which you will save the current php file on your server
  11. and Save!
  12.  
  13. My script is veery very easy to change it! If you want to contact me try 20120202 @t  diamand "."  Gr
  14.  
  15. cheers;)
  16.  
  17. License GNU I suppose
  18. */
  19.  
  20.  
  21.   $file = ".temp" ;  
  22.    if($_GET['temp'] !='') {
  23.         $date = date('Y-m-d h:i:s A') ;
  24.         $temp = substr($_GET['temp'], 0, 5).'&deg;C  <span>('.$date.')</span>' ;
  25.          file_put_contents($file, $temp) ;
  26.  } else $temp = file_get_contents($file) ;
  27.        
  28. ?><!DOCTYPE html>
  29. <html lang="en">
  30. <head>
  31. <meta charset="utf-8" />
  32. <title><?php echo substr($temp, 0, 10); ?> - Εξωτερική Θερμοκρασία στο γραφείο</title>
  33. <meta name="generator" content="Geany 1.27" />
  34. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  35. <meta http-equiv="refresh" content="300" />
  36. <style>#temp { width: 100%; font-size: 50px; font-family: Verdana; text-align: center; }
  37.        #temp span { font-size: 20px; color: #777; font-style: italic; white-space:nowrap; }        
  38. </style>
  39. </head>
  40. <body>
  41. <div id="temp"><?php echo $temp; ?></div>
  42. </body>
  43. </html>

Paste is for source code and general debugging text.

Login or Register to delete or keep track of your pastes.