Hello:
I'm trying to insert the code to the statistics.
I use the ax program.
The code to insert is:
Lainaa
echo '<script type="text/javascript">
<!--
document.write('<img src="http://www.forocv.com/cgi-bin/axs/ax.pl?mode=img&ref=');
document.write( escape( document.referrer ) );
document.write('" height="1" width="1" style="display:none" alt="" />');
// -->
</script><noscript>
<img src="http://www.forocv.com/cgi-bin/axs/ax.pl?mode=img" height="1" width="1" style="display:none" alt="" />
</noscript>';
But always have the same error:
Lainaa
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /web/htdocs/www.forocv.com/home/foro/Themes/classic/index.template.php on line 215
Is correct the code?
Thank you
You don't need to use Javascript...
$ref = urlencode($_SERVER['HTTP_REFERRER']);
echo '<img src="http://www.forocv.com/cgi-bin/axs/ax.pl?mod=img&ref=' . $ref . '" height="1" width="1" style="display:none" alt="" />';
Thank you.
Run Fine.
All the best,
Hello:
I implemented the code of Oldiesmann.
But I have a problem. All visits return one error log
Lainaa
8: Undefined index: HTTP_REFERER
Archivo: /web/htdocs/www.forocv.com/home/foro/Themes/classic/BoardIndex.template.php (eval?)
LĂnea: 101
This error full the error log.
The problem is that HTTP_REFERER is empty?
In php is possible to control this error?
Thank you
Try using, instead:
$ref = urlencode(@$_SERVER['HTTP_REFERRER']);
-[Unknown]
Thank you Unknown.