I
I
Igor Kaspersky2015-11-18 23:45:53
PHP
Igor Kaspersky, 2015-11-18 23:45:53

PHP Page reload, how to add number of reloads to variable?

Hello everyone, after 5 page updates, you need to display a message that you tell me. I found that header("refresh: 3;"); but this is every refrech: second;. Then window.location.reload(). I drive in the search gives me js. Where to read

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergej, 2015-11-18
@HHabar

https://yandex.ru/search/?text=setinterval%20javascript

var countRefresh = 0;
    setInterval(function() {
        countRefresh++;
        if (countRefresh == 5) {
            alert('your msg');
            countRefresh = 0;
        }
    }, 5000);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question