right now i have a session that keeps users logged in for as long as they are on my page but i would like the counter to count each person once and not count me at all
wat can i do?
Printable View
right now i have a session that keeps users logged in for as long as they are on my page but i would like the counter to count each person once and not count me at all
wat can i do?
does anyone know?
have the counter check against your name...
nice sig lol should this be TRUE THEN and not ture?
yourlife = TURE THEN
By default, sessions are only saved per browser session and are removed when the user closes the browse.
However, you can set a separate cookie which will stay in the users cache until it is deleted. To set the cookie, use the set_cookie() function:
Will set the cookie for 10 years. Before recording the visit, you can then check to ensure that the user has not already been recorded by checking for the presence of the cookie:PHP Code:set_cookie ('visited', '1', time() + (60 * 60 * 24 * 365 * 10));
PHP Code:if (! isset($_COOKIE['visited'])) {
/* record visit, only if the cookie is present */
}
It is worth noting that the cookie is only on a per browser basis, therefore, if the user visits the site using a different browser or someone else visits your site using the same computer the visits will not be accurately recorded.