Advertisement
tei123

zapis odczyt

Dec 2nd, 2016
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <html>
  2. <body>
  3. <?php
  4.  
  5. $a=$_GET['nazwa'];
  6. $b=$_GET['data'];
  7. $c=$_GET['cena'];
  8. $d=$_GET['ilosc'];
  9.  
  10. $date1=date_create($b);
  11. $date2=date_create(date('Y-m-d'));
  12.  
  13.  
  14. $diff=date_diff($date1,$date2);
  15. echo $diff->format('%a dni');
  16.  
  17. if ($diff)
  18.  
  19. echo "<br>";
  20. echo "cena calosci to ".$d*$c."<br>";
  21. $dane = "tekst do wprowadzenia\n";
  22.  
  23. $file = "baza.txt";
  24.  
  25. $fp = fopen($file, "a");
  26.  
  27. flock($fp, 2);
  28.  
  29.  
  30. fwrite($fp, $a." ");
  31. fwrite($fp, $b." ");
  32. fwrite($fp, $c." ");
  33. fwrite($fp, $d." ");
  34. fwrite($fp, "\r\n");
  35.  
  36. flock($fp, 3);
  37.  
  38.  
  39. fclose($fp);
  40.  
  41.  
  42. ?>
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement