pero no me funciona me funciona sin clase y sin funcion.
me gustaria saber que es lo que estoy haciendo mal y si me podriais ayudar.
Gracias.
Código PHP:
<?php
/*
UserCake Version: 1.4
http://usercake.com
Developed by: Adam Davis
*/
class NotifyLogs {
//UserCake check host, port and url access
function takeURL(){
$url="http://".$_SERVER["HTTP_HOST"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
return $url;
}
//UserCake check debug mode and maintenance is true or false
function LogError() {
if ($debug_mode === true) {
$sendfinaldate = base64_encode($finaldate);
if((strpos($_SERVER['REMOTE_ADDR'], $adminIP) === 0)) { }
else { if(is_file("maintenance.php")) { header("Location: maintenance.php?FinalDate=$sendfinaldate"); die(); } }
error_reporting(-1);
ini_set("display_errors","On");
ini_set("error_log",$logfiles_dir."error-$today.log");
$myFile = $logfiles_dir."usercake-$today.log";
$fh = fopen($myFile, "a");
$configa = "config";
$pageuser = takeURL();
$ipuser = $_SERVER["REMOTE_ADDR"];
$datelog = date("D M j G:i:s T Y");
$stringData = "userCake Notice: [ $ipuser ] --> [ Anonymous ] --> [$datelog] --> [ $pageuser ] \n";
fwrite($fh, $stringData);
fclose($fh);
}
//UserCake check debug mode and maintenance is true or false
if ($debug_mode === false) {
error_reporting(0);
$myFile = $logfiles_dir."usercake-$today.log";
$fh = fopen($myFile, "a");
$configa = "config";
$pageuser = takeURL();
$ipuser = $_SERVER["REMOTE_ADDR"];
$datelog = date("D M j G:i:s T Y");
$stringData = "userCake Notice: [ $ipuser ] --> [ Anonymous ] --> [$datelog] --> [ $pageuser ] \n";
fwrite($fh, $stringData);
fclose($fh);
}
}
}
?>
Código PHP:
$createlog = new NotifyLogs();
$createlog->LogError();
NotifyLogs::LogError();