1<?php
2//Something to write to txt log
3$log = "User: ".$_SERVER['REMOTE_ADDR'].' - '.date("F j, Y, g:i a").PHP_EOL.
4 "Attempt: ".($result[0]['success']=='1'?'Success':'Failed').PHP_EOL.
5 "User: ".$username.PHP_EOL.
6 "-------------------------".PHP_EOL;
7
8//Save string to log, use FILE_APPEND to append.
9file_put_contents('./log_'.date("j.n.Y").'.log', $log, FILE_APPEND);