Forums

Resolved
0 votes
//logit start
if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])){
//If it does, assume that PHP app is behind Cloudflare.
$quip = $_SERVER["HTTP_CF_CONNECTING_IP"];

} else{
//Otherwise, use REMOTE_ADDR.
$quip = $_SERVER['REMOTE_ADDR'];


}

$file = './log/searchlog.txt';
//echo $file;
$content = date("Y-m-d H:i:s").' '.$quip.' '.$urladdress.'\n';

file_put_contents($file, $content, FILE_APPEND| LOCK_EX);
chmod($file, 0600);
//logitstop

Never mind just needed to
Use winscp set dir (log) to rwx for user apache [48] group apache [48]
Sunday, September 05 2021, 02:30 PM
Share this post:
Responses (0)
  • There are no replies here yet.
Your Reply