Advertisement
DeathMater

Untitled

Nov 23rd, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. include("global.php");
  3.  
  4. error_reporting(E_ALL);
  5. ini_set("display_errors", "on");
  6. ini_set("display_startip_errors", "on");
  7. include_once "header/header.php";
  8. $connect = new mysqli('geheim');
  9. date_default_timezone_set("Europe/Berlin");
  10. $null = "1";
  11.  
  12. ?>
  13. <!DOCTYPE html>
  14. <html>
  15. <head>
  16. </head>
  17.  
  18. <body>
  19. <?php
  20. $timestamp = time();
  21. $datum = date("Y-m-d", $timestamp);
  22. $anzahl = 0;
  23.  
  24. $abfrage = $connect->query("SELECT * FROM Besucher");
  25. $abfrage2 = $abfrage->fetch_assoc();
  26. $anzahl = $abfrage2["Anzahl"];
  27. $anzahl++;
  28. $insert = $connect->prepare("INSERT INTO Besucher (Anzahl, Datum) VALUES($null, $datum) ON DUPLICATE KEY UPDATE Anzahl = $anzahl, Datum = $datum");
  29. $insert->execute();
  30. echo $datum;
  31.  
  32.  
  33.  
  34.  
  35.  
  36. echo "Besucheranzahl:" .$anzahl;
  37. ?>
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement