Warning: filemtime() en php
Bonjour,
en fait je veux afficher la dernière date de modification d'un fichier.txt mais le problème c'est que mon code ça marche quand j’actualise la page.php avant d'afficher le résultat(j’appuie sur f5) sinon il m'affiche cette date 01/01/1970
voila mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <?php
@session_start();
$login= $_SESSION['login_user'];
$a=$_GET['r1'];
$file="D:\\CQIET\\wamp\\www\\projet\\configuration\\en_attente".$a."_".$login."_"."export".".txt";
$d= "D:\\CQIET\\wamp\\www\\projet\\configuration".$a;
// Open the file to get existing content
$date=date("d/m/Y",filemtime($file));
$current = file_get_contents($file);
// Append a new configuration to the file
$current=
$d."\r\n"."".$login."\r\n".$date;
// Write the contents back to the file
file_put_contents($file,$current);
require_once("list_txt.php");
?> |
voila erreur qu'il m'affiche mais quand j’appuie sur f5 il va disparaitre:
Code:
1 2 3 4
|
Warning: filemtime() [function.filemtime]: stat failed for D:\CQIET\wamp\www\projet\configuration\en_attente\export_SkyD_BerlinP_CUSTOMER.conf_kaoutar_export.txt in D:\CQIET\wamp\www\projet\f4.php on line 27
Warning: file_get_contents(D:\CQIET\wamp\www\projet\configuration\en_attente\export_SkyD_BerlinP_CUSTOMER.conf_kaoutar_export.txt) [function.file-get-contents]: failed to open stream: No such file or directory in D:\CQIET\wamp\www\projet\f4.php on line 29 |
Merci d'avance et n’hésitez de m'aider.