Se qualcuno entra nel mio sito link , si accorgerà che il contatore è presente sia in alto a sinistra nel frame col menù, che nella home (Lo so, i frame sono il male, ma tempo di riscrivere tutto assolutamente non ne ho).
Però in questo modo ho dovuto inserire due volte il codice e di conseguenza mi conta ogni accesso 2 volte (i 2contatori ovviamente appaiono sfalsati di una unità).
Come posso fare per inserire il codice solo in uno dei frame e far apparire nell'altro il contatore solo richiamando l'output?

L'errore, che potete leggere nella pagina, recita:

Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0


codice header
Codice PHP:
<?
$FX_digit 
10;
$FX_dpath "public";
$FX_fpath "public/counter.txt";

if (!
file_exists($FX_fpath)) {
 if (!
is_dir($FX_dpath)) {
   
mkdir($FX_dpath0700);
 }
 
$FX_fso fopen($FX_fpath,"w");
 
flock($FX_fso2);
 
fputs($FX_fso4);
 
flock($FX_fso3);
 
fclose($FX_fso);
}

$FX_fso fopen($FX_fpath,"r+");
$FX_count fgets($FX_fso4096);
session_start();
if (!isset(
$HTTP_SESSION_VARS["FX_DataCounter"])) {
 
fseek($FX_fso0);
 
flock($FX_fso2);
 
fputs($FX_fso$FX_count+1);
 
flock($FX_fso3);
 
fclose($FX_fso);
 
$FX_count++;
 
$FX_DataCounter $FX_count;
 
session_register("FX_DataCounter");
}

$FX_numlength strlen((string) $FX_count);
if (
$FX_numlength $FX_digit) {
 
$FX_lead = (int) $FX_digit $FX_numlength;
 for (
$i=0$i<$FX_lead$i++) {
   
$FX_count $FX_count;
 }
}
?>


codice corpo
Codice PHP:
<?php echo $FX_count ?>