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 7960203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:41:31+00:00 2026-06-04T04:41:31+00:00

I was wondering how to detect when a page gets updated with PHP. I’ve

  • 0

I was wondering how to detect when a page gets updated with PHP. I’ve researched things on Google, but came across nothing.

What I want to do is call a specific function when a page gets updated. I will be running a cron job in order to run the code.

I want something like this:

if (page updated) {
//functions
}
else
{
//functions
}

If I can’t do something like that then I want to at least know how to detect when a page gets updated with PHP. Please help!

  • 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-06-04T04:41:33+00:00Added an answer on June 4, 2026 at 4:41 am

    Use file_get_contents() to get the page’s content, create a MD5 hash from it, and compare it with the hash you already have. I suggest storing this hash in a simple file.

    $contents = file_get_contents('http://site.com/page');
    $hash     = file_get_contents('hash'); // the text file where the hash is stored
    if ($hash == ($pageHash = md5($contents))) {
      // the content is the same
    } else {
      // the page has been updated, do whatever you need to do
      // and store the new hash in the file
      $fp = fopen('hash', 'w');
      fwrite($fp, $pageHash);
      fclose($fp);
    }
    

    Don’t forget setting allow_url_fopen to On.

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

Sidebar

Related Questions

I was wondering how I can detect code plagiarism with Javascript. I want to
I'm wondering if there is any way to detect when a page is being
Just wondering if anyone has come across this? Basically, Im looking to detect for
I was wondering if it was possible to detect when a certain process gets
Wondering if there is any tool that can help me to detect a pronoun's
I was wondering how you could detect what platform a program is running on,
I am wondering if it is possible to detect whether the user exits the
I'm new to jquery and was wondering: is a simple way to detect whether
Wondering if anyone can suggest a good file replication tool that will replicate across
Wondering how does an application like Process Explorer or Combo Fix detect hidden process

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.