2011-12-06 2 views
5

Je veux savoir comment créer un fichier journal de mon site web en php? Qui m'aident à maintenir les données sur les pages visitées par chaque utilisateur & toutes les actions qu'ils ont effectuées sur mon site. Donc, n'importe quel copain peut m'aider?Comment créer un fichier journal de mon site web en php?

Thanx,

+0

Qu'est-ce que vous devez vous inscrire dans votre journal? –

+0

Quelles informations souhaitez-vous stocker? Pages visitées par chaque utilisateur, actions générales ... soyez plus clair! –

Répondre

25
$file = 'people.log'; 
// The new person to add to the file 
$person = "John Smith\n"; 
// Write the contents to the file, 
// using the FILE_APPEND flag to append the content to the end of the file 
// and the LOCK_EX flag to prevent anyone else writing to the file at the same time 
file_put_contents($file, $person, FILE_APPEND | LOCK_EX); 

S'il vous plaît voir la page de manuel pour file_put_contents().

+1

Merci d'avoir corrigé cette réponse. J'ai enlevé mon downvote. – Treffynnon

Questions connexes