You need javascript:
<script type="text/javascript">
setTimeout(onUserInactivity, 1000 * 120)
function onUserInactivity() {
window.location.href = "https://stackoverflow.com/questions/15966686/onUserInactivity.php"
}
</script>
This will redirect the user after 2 Minutes of inactivity. If you want to make it dependend of the mouse-moving, try:
<script type="text/javascript">
inactivityTimeout = False
resetTimeout()
function onUserInactivity() {
window.location.href = "https://stackoverflow.com/questions/15966686/onUserInactivity.php"
}
function resetTimeout() {
clearTimeout(inactivityTimeout)
inactivityTimeout = setTimeout(onUserInactivity, 1000 * 120)
}
window.onmousemove = resetTimeout
</script>
3
solved auto redirect after no user action [duplicate]