Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html xml:lang="fr" lang="fr">
  3. <head>
  4. <title> Notre première instruction </title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  6. <meta http-equiv= "refresh" content="5" />
  7.  
  8. </head>
  9. <body>
  10. <?php
  11.  
  12. try{
  13. $bdd = new PDO('mysql:host=localhost;dbname=test3', 'root', '');
  14.  
  15. }
  16. catch(Exception $e){
  17. die('Erreur : '.$se->getMessage());
  18.  
  19. }
  20.  
  21. $homepage = file_get_contents('http://172.20.107.22/');
  22. $jour=date('Y-m-d');
  23. $heure=date('H:i:s');
  24.  
  25.  
  26.  
  27.  
  28. $bdd->exec("INSERT INTO capteur (id, texte , date_jour) VALUES(NULL, '$homepage' , '$jour')");
  29. echo ('La valeur est');
  30. echo ($homepage);
  31. echo("le");
  32. echo($jour);
  33.  
  34.  
  35.  
  36.  
  37. ?>
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement