techker Posted October 10, 2006 Share Posted October 10, 2006 hey guys is it possible to make an invisible counter that only the admin could access it thru an admin panel? Quote Link to comment https://forums.phpfreaks.com/topic/23540-invisible-counter/ Share on other sites More sharing options...
Gruzin Posted October 10, 2006 Share Posted October 10, 2006 yes, you can easly do that, also you could try some simple counter, such as [url=http://www.flash-counter.com]http://www.flash-counter.com[/url] Quote Link to comment https://forums.phpfreaks.com/topic/23540-invisible-counter/#findComment-106811 Share on other sites More sharing options...
techker Posted October 10, 2006 Author Share Posted October 10, 2006 i have the counter but im worduring how to hide it and access it agiain? Quote Link to comment https://forums.phpfreaks.com/topic/23540-invisible-counter/#findComment-106815 Share on other sites More sharing options...
Gruzin Posted October 10, 2006 Share Posted October 10, 2006 Here what I use, this script counts universal users for me:[code]<?phprequire ("db.php");$date = date('d, M, Y, h: m'); // get currnet date$userip = $_SERVER['REMOTE_ADDR']; //get user ip$c_ip = $HTTP_COOKIE_VARS["user_ip"]; //set cookies to remeber user ipsetcookie("user_ip", $REMOTE_ADDR, time()+86400); // remember cookie for seconds -1 dayif($c_ip != $userip) { mysql_query("INSERT INTO count (date,userip)VALUES ('$date','$userip')"); // if remote address is not equal to cookied ip DO Count }mysql_close($con);?>[/code]To view it I just need to log in to my secure page and display the result:[code]<?php require ("db.php");$result = mysql_query("SELECT*FROM count WHERE number");echo "<table border='1' bordercolor='#95B5C6'><tr><th>Date</th><th>User IP</th><th>Number</th></tr>";while($row = mysql_fetch_array($result)) { echo "<tr><td>"; echo $row['date']; echo "</td><td>"; echo $row['userip']; echo "</td><td>"; echo $row['number']; echo "</td></tr>"; }echo "</table>";mysql_close($con);?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/23540-invisible-counter/#findComment-106824 Share on other sites More sharing options...
techker Posted October 10, 2006 Author Share Posted October 10, 2006 so i put the first code in one page and the other in a seprate page . Quote Link to comment https://forums.phpfreaks.com/topic/23540-invisible-counter/#findComment-106826 Share on other sites More sharing options...
Daniel0 Posted October 10, 2006 Share Posted October 10, 2006 Yes. Quote Link to comment https://forums.phpfreaks.com/topic/23540-invisible-counter/#findComment-106834 Share on other sites More sharing options...
techker Posted October 10, 2006 Author Share Posted October 10, 2006 but how does it know witch page i want to count? Quote Link to comment https://forums.phpfreaks.com/topic/23540-invisible-counter/#findComment-106840 Share on other sites More sharing options...
Daniel0 Posted October 10, 2006 Share Posted October 10, 2006 Save file one as eg counter.phpThen on the pages you want counted, put this: [code]include("counter.php");[/code] Quote Link to comment https://forums.phpfreaks.com/topic/23540-invisible-counter/#findComment-106848 Share on other sites More sharing options...
techker Posted October 10, 2006 Author Share Posted October 10, 2006 i get errors?were is db.php? Quote Link to comment https://forums.phpfreaks.com/topic/23540-invisible-counter/#findComment-106895 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.