1

I am using Server Side Scripting for my callback notification sections

 header("Refresh:10;url='domain/admin/callback.php'"); 

but the all the admin panel pages are redirecting to same page which I have given in URL section. Please help me out. Thank you.

I have one PHP page which contains mail notification to customer. I want to run that file for every 15 minutes. Apart from above logic if you have any better suggestions will be appreciated.

Thank you.

Akash M
  • 488
  • 3
  • 6
  • 18
  • Javascript interval Ajax calls to that file and display the result locally? – Tobin Mar 03 '18 at 12:35
  • 2
    Possible duplicate of [How to automatically reload a page after a given period of inactivity](https://stackoverflow.com/questions/4644027/how-to-automatically-reload-a-page-after-a-given-period-of-inactivity) – Nawin Mar 03 '18 at 12:36
  • If you can keep a page alive, then setting refresh interval in meta like `` will be a good choice. – Phil Mar 03 '18 at 12:43

1 Answers1

1

Edit: I think I've just worked out what you were asking.

You can call a PHP script every 15 minutes via an AJAX request.

setInterval(function() {
   $.post(
    "/path/to/your/script.php",
        {
            data: your_posted_data
        },
        function(data, status){
            alert(data);
        }
    );
}, 15 * 60 * 1000); // 15 * 60 * 1000 milsec = 15 mins

The returned data can be, say, the new notifications that the user has received, and you can update any elements on your page accordingly. Hope this helped and wasn't too obvious.