I have a website page that will, on visit, redirect you to random picture from my website using this script:
<script type="text/javascript">
var urls = new Array();
urls[0] = "http://localhost/dir/wp-content/uploads/2018/05/logo.png";
urls[1] = "http://localhost/dir/wp-content/uploads/2018/05/logo2.png";
urls[2] = "http://localhost/dir/wp-content/uploads/2018/05/logo3.png";
var random = Math.floor(Math.random()*urls.length);
window.location = urls[random];
</script>
But, before that I want to limit users so that they can visit my page only once per day (24h) by blocking their IP address.
Is that doable or there is a better way?
Aucun commentaire:
Enregistrer un commentaire