Know Time a visitor stays on website [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
i want to know how much time a visitor stays on my website..??? can it be done with any online services ??..Any help would be appreciated..

Use Google analytics http://www.google.com.au/analytics/
A session can only change every time you call set or reset it.
But if you wanted to, you could use jQuery ajax, to run a script every X seconds or mins. Then in the file that you are ajax'ing in. Change your session data.
You will find analytics make a new request every time the user does something. Like moves the mouse, clicks on something, etc. So you would have to set up some js to do that as well.

Related

Is there a smart way open a node js server on your website while still using php [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
i have a website where you click on a tomato and get points based on how many times you've klicked on it. The problem is that it's all running on php and AJAX requests. Every 10 seconds an request is sent on how many clicks the user has now, and the server updates. So in theory a user could just send requests of them having 30000 clicks and it would register. A friend of mine said that i should use node and register every click individualy with a socket, but everything so far is running on php. Is there a way to open a node server and make it talk with php?

Count the amount of users that are logged in [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am working on a school project. The assignment is to recreate our own version of Ebay. A requirement is to display the number of logged in users. What is the best way to do this? We are using PHP.
We are using a database so we could save the amount of loggins there but there is no proper way to decrease this amount since people often just leave the site without logging out.
Some suggestions would be awesome!
you could have a heartbeat script that updates a datetime on the user column.
and the show logged in users script could get all logged in users with time < 5 mins

How To Prevent Reload in a PHP page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
How can I prevent a user from actions like: accessing page from reloading, double clicking and multiple windows.
Several bank websites blocked users from reloading and multiple window opening, like for example: icicibank.com or onlinesbi.com.
Long answert short: you can't.
The browser isn't yours, it's the users. Don't tell him what to do.
What you can do, is punishing them when they do so. Like, showing him a javascript popup asking him not to, and prevent the page to show again if he refreshes, using a token for instance.

Run script when session starts? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How do I run a script (ie, $viewcount += 1;) when a session starts in PHP? I'm trying to make a view counter script for my website which currently works, assuming I include('view_counter.php') in every page to add something to my text file of views. Unfortunately, people can reload the page and so add up the view count really quickly. What I'd like to do is add to the view count every time somebody opens a new session on the site. It should be obvious, but how do I do it?
Just check if the Session object exists or not yet using an IF statement, and if it doesn't, it means it's a new session in which you can run your counter code.
More info on working with sessions: Check whether a session is new in PHP

Limiting python script to run 15 times per hour in PHP [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm making a Twitter App and twitter makes it so any application won't run more than 15 times an hour.
I execute a python script when a user presses a button that gets the top 5 trends on twitter.
I am using PHP and MongoDB NoSQL to store my data.
When I searched for an answer I came across --> this but they are using a SQL DB.
My Question,
How can I tell the user has executed the script 15 times within an hour?
Each time the user runs the app, add their clicks to an object including its time.
When they run your script, pull these objects out, look through their dates, and delete everything with a timestamp more than an hour old and count the rest.

Categories