Thank you, now the script works.
Anyway I'm facing another problem.
If I set the joomla cache of my site Off, then at every refresh I get +1.
Anyway, If I turn On the cache plugin, then I get +1 the first time I load the page and then it stop counting. I need to clear cache for get another +1 in the view count of that page.
From admin panel I see that every other page reload doesn't get count by the script.
How can I fix this?
I thought maybe I could disable caching for this little script. There are many plugin for this in Joomla, but I have no idea how to do this in php.