Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • For older versions, where Aaron’s plugin may not work or somehow you can’t set it up, this basic thing is always there – logging to a file –

    function log_msg( $s = "" ){
    	fileputcontents("qry.log", date("d-m-Y h:i:s a :=").$s."\n");
    }
    function fileputcontents($path,$string){
    	$error = false;
    	if(!($fp = fopen($path,'a'))){
    		$error = true;
    	}
    	if (fwrite($fp, $string) === FALSE) {
    		$error = true;
        }
        fclose($fp);
        if($error){
        	return false;
        }else{
        	return true;
        }
    }

    note: the function name “fileputcontents” is just indicative that it is doing the same thing as the PHP 5 function file_put_contents(,,,FILE_APPEND);

    It is very basic, so it is use-ful as well as feature-less.

    Thread Starter 2stepsback

    (@2stepsback)

    the download for march 2007 can be found at:
    DivShare File – CodexMar2007.zip

    hth,
    2stepsback

Viewing 2 replies - 1 through 2 (of 2 total)