if (!isset($f))
{
$file = fopen(".log","w+");
$text = "$REMOTE_HOST ($REMOTE_ADDR (user $REMOTE_IDENT)), coming from $HTTP_REFERER accessed $PHP_SELF on ";
$text .= date("m-d-Y @ h:i a (Gi);
fputs($file,$text);
fclose($file);
}
else {
$file = fopen(".log","w+");
$text = "$REMOTE_HOST ($REMOTE_ADDR (user $REMOTE_IDENT)), coming from $HTTP_REFERER went to $f on ";
$text .= date("m-d-Y @ h:i a (Gi);
fputs($file,$text);
fclose($file);
header("Location: $path/$f");
}
Now, save a few minor changes, this code is the exact same. However, everything falls apart once it gets to the $file = fopen(".log","w+") in the else block. Why?