<?
function logit($ss){
$filename = 'test.txt';
chmod ($filename, 0777);
echo $filename;
    if (!$handle = fopen($filename, 'a')) {
         print "can not open $filename";
         exit;
    }
    if (!fwrite($handle, $ss)) {
        print "can not write to $filename";
        exit;
    }
    print "write $ss to $filename";
    fclose($handle);
	chmod ($filename, 0766);
}
//$_POST = $_GET;
$ss = "";
foreach($_POST as $v=>$k){
	$ss.="$v = $k\n";
}

logit($ss);
logit("----------------------------------------\n");

?>
