Hola tengo un problema y no se por donde esta o no me estoy dando cuenta, me podriais hechar una mano porfavor?
lo que quiero es que me saque el resultado y escriba uno nuevo.
Código PHP:
Ver original<?php
function initCounter() {
global $db,$db_table_prefix;
$Counterip = $_SERVER['REMOTE_ADDR']; //get visitor ip
$Counterremoteport = $_SERVER['REMOTE_PORT']; //get visitor ip
$Counterlocation = $_SERVER['PHP_SELF']; //get server file path
$Counterbrowser = $_SERVER['HTTP_USER_AGENT']; //get the browser name
$Counterfrom_page = $_SERVER['REQUEST_URI']; //page from which visitor
$CounterDate = date('Y-m-d');
//create log in database table 'counter'
$sql = "INSERT INTO ".$db_table_prefix."StatTracker
(Browser,IP,Port,Date_Visited,Page,From_Page)VALUES(
'".$db->sql_escape(sanitize($Counterbrowser))."',
'".$db->sql_escape(sanitize($Counterip))."',
'".$db->sql_escape(sanitize($Counterremoteport))."',
'".$CounterDate."',
'".$db->sql_escape(sanitize($Counterlocation))."',
'".$db->sql_escape(sanitize($Counterfrom_page))."'";
return $db->sql_query($sql);
}
function getCounter($mode, $Counterlocation = NULL) {
global $db,$db_table_prefix;
$Counterlocation = $_SERVER['PHP_SELF'];
}
if($mode == "unique") {
$sql = "SELECT DISTINCT IP
FROM ".$db_table_prefix."StatTracker
WHERE From_Page = '".$db->sql_escape(sanitize($Counterlocation))."'";
} else {
$sql = "SELECT IP
FROM ".$db_table_prefix."StatTracker
WHERE From_Page = '".$db->sql_escape(sanitize($Counterlocation))."'";
}
return $db->sql_query($sql);
}
echo getCounter('hits');
echo getCounter('unique');
?>
pero al hacerlo me saca esto en la web
Resource id #19Resource id #20
gracias