All pastes #470800 Raw Edit

simple logging code

public php v1 · immutable
·published 2007-05-04 14:31 UTC
rendered paste body
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;    }}