SHARE
TWEET

Untitled

a guest Nov 19th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $dia=$_POST['dia'];
  3. $temp=$_POST['temp'];
  4. $numero=0;
  5. $fechas="";
  6. $temperaturas="";
  7. if (isset($_COOKIE['numero'])) {
  8.     $numero=$_COOKIE['numero'];
  9.     $temperaturas=$_COOKIE['temperaturas'].',';
  10.     $fechas=$_COOKIE['fechas'].',';
  11. }
  12. $numero++;
  13. $temperaturas = $temperaturas . $temp;
  14. $fechas=$fechas . $dia;
  15. setcookie('temperaturas', $temperaturas , time()+(365*24*3600));
  16. setcookie('numero', $numero , time()+(365*24*3600));
  17. setcookie('fechas', $fechas , time()+(365*24*3600));
  18.  
  19.  
  20. echo "numero de dias: " . $numero;
  21. //echo $temperaturas;
  22. //echo $fechas;
  23. $aux=explode(',',$temperaturas);
  24. $min=$aux[0];
  25. for ($i=0;$i<count($aux);$i++){
  26.     if ($min>$aux[$i]){
  27.         $min=$aux[$i];
  28.     }
  29. }
  30. echo "Temperatura minima: " . $min;
  31.  
  32.  
  33. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top