Nieuw lid |
|
Ik heb een stukje code in mijn script gezet om een logfile te maken indien deze niet bestaat:
// Check logfile
$logfile = "logs/" . md5($username) . ".log";
if(!file_exists($logfile)) {
$logwrite = fopen($logfile, 'w') or die("Log die: Couldn't create log file for user.");
$logline = "Log file for " . $username . " created!\n";
fwrite($logwrite, $logline);
fclose($logwriting);
}
// Check logfile $logfile = "logs/" . md5($username) . ".log"; $logwrite = fopen($logfile, 'w') or die("Log die: Couldn't create log file for user."); $logline = "Log file for " . $username . " created!\n"; }
Maar als ik deze code run krijg ik de volgende error:
Warning: fopen(logs/ce36678bb05a7e907016db40c4a6696b.log) [function.fopen]: failed to open stream: Permission denied in C:\Inetpub\vhosts\businessgame.be\httpdocs\user.information.php on line 71
Log die: Couldn't create log file for user.
|