Bonjour, je galère à afficher la dernière date de visite du site, sans BDD.

HELP ME PLEASE GUYS OR WOMENS !
Voici mon code :
<?php
$date = date("d-m-Y");
$heure = date("H:i");
$madate = fopen('compteur/madernierevisite_anissa.txt',"r+");
$date_vue = fgets($madate); // On lit la première ligne (dernière date vue)
$dernieredate = file_put_contents('compteur/madernierevisite_anissa.txt', $date, $heure); // écrase le contenu du fichier
fseek($madate, 0); // On remet le curseur au début du fichier
fputs($dernieredate, $date_vue); // On écrit la nouvelle date
fclose($dernieredate);
echo("$date - $heure");
?>
La date s'affiche, mais ça me retourne les lignes suivantes : :
"Warning: fopen(compteur/madernierevisite_anissa.txt): failed to open stream: Aucun fichier ou dossier de ce type in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 52
Warning: fgets() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 53
Notice: A non well formed numeric value encountered in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 54
Warning: file_put_contents(compteur/madernierevisite_anissa.txt): failed to open stream: Aucun fichier ou dossier de ce type in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 54
Warning: fseek() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 55
Warning: fputs() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 56
Warning: fclose() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 57
Une idée les warriors du code svp ?
Bonjour, je galère à afficher la dernière date de visite du site, sans BDD.
:priere: :priere: :priere: HELP ME PLEASE GUYS OR WOMENS ! :priere: :priere: :priere:
[u]Voici mon code :[/u]
[i]<?php
$date = date("d-m-Y");
$heure = date("H:i");
$madate = fopen('compteur/madernierevisite_anissa.txt',"r+");
$date_vue = fgets($madate); // On lit la première ligne (dernière date vue)
$dernieredate = file_put_contents('compteur/madernierevisite_anissa.txt', $date, $heure); // écrase le contenu du fichier
fseek($madate, 0); // On remet le curseur au début du fichier
fputs($dernieredate, $date_vue); // On écrit la nouvelle date
fclose($dernieredate);
echo("$date - $heure");
?>[/i]
[u]La date s'affiche, mais ça me retourne les lignes suivantes :[/u] :
"Warning: fopen(compteur/madernierevisite_anissa.txt): failed to open stream: Aucun fichier ou dossier de ce type in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 52
Warning: fgets() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 53
Notice: A non well formed numeric value encountered in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 54
Warning: file_put_contents(compteur/madernierevisite_anissa.txt): failed to open stream: Aucun fichier ou dossier de ce type in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 54
Warning: fseek() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 55
Warning: fputs() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 56
Warning: fclose() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/www/Planning_franky/PlanningAnissa.php on line 57
[b][color=#0000BF]Une idée les warriors du code svp ?[/color][/b]