Hi there,
I am implementing a hit counter on a website using cookies and have some php script that retrieves the count from adatabase and assigns it to a variable. I have this script at the top of the page before all the html related syntax.
I am printing the count in the footer of my pages, which is obtained externally through a php 'include' statement.
However, the count does not show. Nothing appears on the screen. I would like to know whether the variable created at the top of the page has page-wide significance. I created the variable with the 'global' syntax, and it should work. However it is not.
Any ideas?
Cheers
php variable scope issue
Moderator: General Moderators
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: php variable scope issue
I don't think the cookie would be recognized until the page is refreshed...