"); } else fputs($log, "Logged IP address: $ip - Date logged: $date\ "); fclose($log); } // Place the below function call wherever you want the script to fire. logIp(); ?>