joinnew Posted December 18, 2006 Share Posted December 18, 2006 Can anyone help me?How to use Application variable in PHP is the same as ASP, JSP Link to comment Share on other sites More sharing options...
justsomeguy Posted December 18, 2006 Share Posted December 18, 2006 There is no application object in PHP. What properties or methods in the application object are you trying to use? Link to comment Share on other sites More sharing options...
joinnew Posted December 19, 2006 Author Share Posted December 19, 2006 Thanks youExample, i want showing number of users access websiteNomally, in ASP, JSP, i use Application Object. Can you help me? Link to comment Share on other sites More sharing options...
justsomeguy Posted December 19, 2006 Share Posted December 19, 2006 If you want to show the number of users currently online, what we have been telling people to do is keep track of IP address/timestamp combinations in a database. To do that, you need a piece of code on every page that checks the user's IP address, and checks if the IP is already in the database. If it is not, then you add the IP address with the current timestamp. If it is already there, then you update the timestamp to the current time. Then, to see how many people are using the site, you can get the number of users with a timestamp greater then, for example, 5 minutes ago.There is a PHP function called session_set_save_handler, I think that an easier way would be to use that function to define your own session handling functions that would store sessions in the database. Then you wouldn't have to explicitly update the IP/timestamp info on each page. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now