2011-12-06 8 views
5

Quiero saber cómo crear un archivo de registro de mi sitio web en php? Que me ayudan a mantener los datos sobre las páginas visitadas por cada usuario & todas las acciones que hicieron en mi sitio web. Entonces, ¿algún amigo puede ayudarme?¿Cómo crear un archivo de registro de mi sitio web en php?

Gracias,

+0

lo que necesita para registrarse en su registro? –

+0

¿Qué información desea almacenar? Páginas visitadas por cada usuario, acciones generales ... ¡por favor sea más claro! –

Respuesta

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); 

Por favor, vea la página del manual para file_put_contents().

+1

Gracias por mejorar esta respuesta. He eliminado mi voto negativo. – Treffynnon

Cuestiones relacionadas