Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7004205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:10:08+00:00 2026-05-27T21:10:08+00:00

I need to create an event listener. I’m a novice so be kind :)

  • 0

I need to create an event listener. I’m a novice so be kind 🙂

Basically I am on page1.php (php file); I want inside a loop to go check page2.xml (xml file) for some information which should be received at some point. Either check it all the time, or wait and every 5 minutes or so to see if some information has been received there. Either of them work for me.

If no info has been received after a few minutes, then I want to run again the loop (until it is received), otherwise, move forward and do something with my newly received information. This part I have no problem with, just the event listener itself. I couldn’t find the function I should be using anywhere. 🙁 I only need to check and retrieve the content of the xml file every so often.

I am not so sure how I should go about this if there isn’t just a function which does this, but I couldn’t find much when I searched for “event listener php”.

Any help would be appreciated: reference to tutorials/sample code/even just telling me what keywords I should be looking for or what I need to learn first in order to do this.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:10:08+00:00Added an answer on May 27, 2026 at 9:10 pm

    I did the following:

    Automatically saved to database every time something new came in.

    Then ran a php loop that every few minutes checked to see if there is something new in the database which fits the parameters of this new event (including that it happenned within the timeframe of the past few minutes). I used flush(); and then sleep(120); in the loop to get the loop to keep running every few minutes, until the new info came in in which case it will break(); or die();.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a recurring event in SharePoint calendar. I am able to
I need to create several Divs dynamically, and I need to add onmouseover event
i need create a variable with parent subclass. Example: Parent Class <?php class parentClass
I use MS SQL 2008 R2, I need create a Table with a CHECK
The task is to create event handlers in runtime. I need the one method
I need to bind event listener to all dynamicaly created elements by given css
I am creating a radiofield and I need to create an event when the
I am not looking to create new events. I need to create a canvas
I need to create an article system where no articles are ever deleted. Even
I need create custom dialog and put JPanel into it. Is it possible?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.