?php / / removes a file from the hard drive that / / the PHP user has access to. $username = $_SERVER[ 'REMOTE_USER']; / / using an authentication mechanisim $homedir = "/ home / $username"; $file_to_delete = basename("$userfile"); / / strip paths unlink ($homedir / $file_to_delete); $fp = fopen(" / home / logging / filedelete.log" ,"+a"); / /log the deletion $logstring = "$username $homedir $file_to_delete"; fputs ($fp, $logstring); fclose($fp); echo "$file_to_delete has been deleted !";?
?php / / Efface un fichier sur le disque où l'utilisateur à le droit d'aller $username = $HTTP_SERVER_VARS['REMOTE_USER']; / / utilise un mécanisme d'authentification $homedir = "/ home / $username"; $file_to_delete = basename("$userfile"); / / supprime le chemin excédentaire unlink ($homedir / $file_to_delete); $fp = fopen(" / home / logging / filedelete.log" ,"+a"); / /note l'effacement $logstring = "$username $homedir $file_to_delete"; fputs ($fp, $logstring); fclose($fp); echo "$file_to_delete a été éffacé !";?