Problem writing a log file ( using fwrite )

Experienced Elementalist
Joined
Jul 4, 2004
Messages
211
Reaction score
0
I have done this god knows how many times before but i cant get this to work this time... must be because im tired but yea:

I get
php_error said:
Warning: fwrite(): supplied argument is not a valid stream resource in C:\Program Files\xampp\htdocs\PortSys\include\functions.php on line 38

Line38 ( and relevent lines it uses ):
PHP:
$logFile="$self/log/log.txt"; // $self = $_SERVER['PHP_SELF'] just stuck in a veriable called $self 
$log=fopen($logFile,"a+");
fwrite($log,"LOG: $msg -- \n \t FROM: $ip \n \t ON PORT: $rport \n \t FROM HOST: $rhost \n END_LOG \n");

$msg is a string "omg" atm.

Thanks in advance
 
lol... nvm i fixed it, i needed to have $log=fopen('$logFile',"a+"); , needed the ' '.

Thanks.

edit: Bah that didnt fix it but w/e ill just do it a different way...
 
Last edited:
Back