Jump to content

md5_file question


darkcarnival

Recommended Posts

hi,

I'm interested in using the md5_file function as a way to check for a new verison of a script of mine.

currently i have a variable setup that i check but thats too much hassle when i have to update it for bug releases.

this md5_file function looks like something that would easier for me to check, if im wrong let me know.

now i checked on the php official site, but they dont give much detail on it so I'm hoping someone here knows a bit more about the workings of that function.

much thanks :)
Link to comment
Share on other sites

Something like this should solve your problem.

[code]<?php
$old = "the old hash would in some way be stored in this variable";

if(md5_file("http://example.com/the_file.tar.gz") === $old)
{
echo "A new version has been released";
}
else {
echo "No updates are available";
}
?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.