Hey,

<?php

function logfiles($ipadres,$time, $pagina, $status)
{
$datum = date('d-m-Y H:i:s', $time);

$file = fopen("logfiles/logbestand.txt", a, 1024);
fwrite($file, "[$ipadres] [$datum] [$pagina] [$status]");
fclose($file);
}

?>

Ik heb nu 1024 is toch de lengte?
Ik wil graag dat hij na 1x iets geschreven te hebben de volgende keer een dat hij een nieuwe regel gebruikt. Dus dat het overzicht blijft in logbestand.txt.

Alvast bedankt voor je hulp!
kijk is naar de documentatie, http://be.php.net/manual/en/function.fopen.php
Probeer eens zonder die 1024 en gebruik a+

zo dus
<?php
fopen("logfiles/logbestand.txt", "a+");
?>

en haal je variabelen buiten quotes!

zo dus

<?php
fwrite($file, "[" . $ipadres . "] [" . $datum . "] [" . $pagina . "] [" . $status . "]");
?>

Reageren