1

So i have a web page that displays logs of users using my software in 'real-time', but the only way the log list will refresh is if i reload the entire page. I was wondering if it was possible to execute a simple php script like this every 5 seconds without needing to refresh the page:

<?php echo file_get_contents(myurl); ?>

i know i could host this script on another page and put it in an iframe and refresh that every 5 seconds, but i was wondering if i could just refresh only the php code?

JeffCoderr
  • 283
  • 1
  • 4
  • 16
  • i dont think that's the right dupe, i think he wants ajax to reload part of the page (http://stackoverflow.com/questions/17886578/refresh-part-of-page-div) –  Aug 07 '16 at 23:06
  • LOL, this got marked as a dupe? StackOverFlow needs to regulate it's crazy staff / moderators... – JeffCoderr Aug 07 '16 at 23:26
  • 1
    we are not staff. mistakes can be made, i can change the dupe to the one i posted but was waiting to here back from you. –  Aug 07 '16 at 23:28
  • @Dagon you're welcome to reopen and mark yours as the one you think. I posted that dupe for 2 reasons. 1) That's what I thought the question was about. 2) There was an answer given for same. – Funk Forty Niner Aug 07 '16 at 23:54
  • @JeffCoderr I agree with Dagon; we are not perfect. You could have also posted a comment under the answer that was given, yet I saw nothing of the sorts. You just went and called "me" crazy (which in a way I probably am *lol* in my own right). I made a mistake and that's that and I apologize for it. It was an "honest" mistake. – Funk Forty Niner Aug 07 '16 at 23:55
  • @Dagon No need for you to reopen, I just did now. – Funk Forty Niner Aug 07 '16 at 23:57
  • Ajaxs would be a good place to start. – Teddy Codes Aug 08 '16 at 03:45

1 Answers1

-4

If you've got access to the shell or to the crontab you could create a cronjob with this script that runs every 5 seconds.

csabinho
  • 1,579
  • 1
  • 18
  • 28