youngvet1 Posted November 12, 2007 Share Posted November 12, 2007 I really need some help --I am trying to get a HTML pages source then coumapre it to the HTML that would be shown if I click 'view source' and match them up?? This is what I have and have been trying but they are not matching, since I set $start_source = to the exact source code of the HTML page I thought they should be equal?? <?php ///////////HTML from viewing pages current source ///////////////////////////// $start_source='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="generator" content="Adobe GoLive" /> <title>Rival NYC</title> <style type="text/css"> @import url(style.css); </style> <SCRIPT LANGUAGE="JavaScript"> function checkEmail(myForm) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){ return (true) } alert("Invalid E-mail Address! Please re-enter.") return (false) } </script> </head> <body bgcolor="#000000"> <table cellspacing="0" cellpadding="0" border="0" align="center"> <tr><td colspan="3" style="font-family:arial;"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="813" height="500"> <param name="movie" value="countdownRival.swf"> <param name="quality" value="high"> <embed src="countdownRival.swf" width="813" height="500" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed> </object> </td></tr> <tr> <td width="100"></td> <td width="300" style="background-image:url(emailaddrival.jpg);background-repeat: no-repeat;padding-left:280px;padding-top:4px;" align="center" valign="top"> <form action="" method="post" onSubmit="return checkEmail(this)"> <input name="email" type="text" value="ENTER YOUR EMAIL" size="27" style="border: solid 1px #2f2f2f;background-color:black;color:white;font-size:11px;"> <input type="image" src="http://www.lifevstyle.com/submit.jpg" align="top" name="Submit" value="submit"> </form> </td> <td width="100"></td> </tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><font style=\'color:red;\'>address:</font> 225 Hudson Street New York,NY 10013 <font style=\'color:red;\'>phone number:</font> 212-929-7222 <font style=\'color:red;\'>email:</font> [email protected]. </td></tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><a href="http://www.myspace.com/rivalllc" style=\'color:red;\'>Rival Myspace</a></td></tr> </table> </body> </html>'; //////////////////////////////////////////////////////////////////////////////////////////////////// $end_source= highlight_file("http://www.lifevstyle.com/rivalnyc/",TRUE); if ( $start_source == $end_source ){ echo "they are the same"; } ?> any way any help very very appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/ Share on other sites More sharing options...
wildteen88 Posted November 12, 2007 Share Posted November 12, 2007 Why are you using highlight_file? Using this function PHP will apply syntax highlighting to the code in the requested file (it'll add in extra html) and thus $start_source and $end_source wont match. Use file_get_contents instead. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-390040 Share on other sites More sharing options...
youngvet1 Posted November 12, 2007 Author Share Posted November 12, 2007 Ok switched the function to using file_get_contents but still they dont match, not sure why. This is what I have <?php /////////////////////////////////////////////////////////////////////////////////////////////////// $start_source='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="generator" content="Adobe GoLive" /> <title>Rival NYC</title> <style type="text/css"> @import url(style.css); </style> <SCRIPT LANGUAGE="JavaScript"> function checkEmail(myForm) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){ return (true) } alert("Invalid E-mail Address! Please re-enter.") return (false) } </script> </head> <body bgcolor="#000000"> <table cellspacing="0" cellpadding="0" border="0" align="center"> <tr><td colspan="3" style="font-family:arial;"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="813" height="500"> <param name="movie" value="countdownRival.swf"> <param name="quality" value="high"> <embed src="countdownRival.swf" width="813" height="500" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed> </object> </td></tr> <tr> <td width="100"></td> <td width="300" style="background-image:url(emailaddrival.jpg);background-repeat: no-repeat;padding-left:280px;padding-top:4px;" align="center" valign="top"> <form action="" method="post" onSubmit="return checkEmail(this)"> <input name="email" type="text" value="ENTER YOUR EMAIL" size="27" style="border: solid 1px #2f2f2f;background-color:black;color:white;font-size:11px;"> <input type="image" src="http://www.lifevstyle.com/submit.jpg" align="top" name="Submit" value="submit"> </form> </td> <td width="100"></td> </tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><font style=\'color:red;\'>address:</font> 225 Hudson Street New York,NY 10013 <font style=\'color:red;\'>phone number:</font> 212-929-7222 <font style=\'color:red;\'>email:</font> [email protected]. </td></tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><a href="http://www.myspace.com/rivalllc" style=\'color:red;\'>Rival Myspace</a></td></tr> </table> </body> </html>'; $end_source= file_get_contents("http://www.lifevstyle.com/rivalnyc/"); if ( $start_source == $end_source ){ echo "they are the same"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-390109 Share on other sites More sharing options...
cooldude832 Posted November 12, 2007 Share Posted November 12, 2007 simple way is a md5checksum of the file, store it and then check if it has changed. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-390113 Share on other sites More sharing options...
youngvet1 Posted November 12, 2007 Author Share Posted November 12, 2007 A little new to this, could give me a little explanation. Is this a function? Also I notice that on this ( http://www.lifevstyle.com/rivalnyc/ ) when I view the page info the "last modified" is always updating probabaly becuase of the swf file. Would this efect this approach. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-390146 Share on other sites More sharing options...
youngvet1 Posted November 13, 2007 Author Share Posted November 13, 2007 anyone? help appreciated Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-391044 Share on other sites More sharing options...
pkSML Posted November 14, 2007 Share Posted November 14, 2007 A little new to this, could give me a little explanation. Is this a function? Also I notice that on this ( http://www.lifevstyle.com/rivalnyc/ ) when I view the page info the "last modified" is always updating probabaly becuase of the swf file. Would this efect this approach. Yes, md5 is a function. See http://php.net/md5 You might use crc32() as well -> http://php.net/crc32 Just md5 or crc32 the string from your code and do the same for the file_get_contents string. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-391063 Share on other sites More sharing options...
youngvet1 Posted November 14, 2007 Author Share Posted November 14, 2007 ok here is my code I still do not get them to match: <?php /////////////////////////////////////////////////////////////////////////////////////////////////// $start_source='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="generator" content="Adobe GoLive" /> <title>Rival NYC</title> <style type="text/css"> @import url(style.css); </style> <SCRIPT LANGUAGE="JavaScript"> function checkEmail(myForm) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){ return (true) } alert("Invalid E-mail Address! Please re-enter.") return (false) } </script> </head> <body bgcolor="#000000"> <table cellspacing="0" cellpadding="0" border="0" align="center"> <tr><td colspan="3" style="font-family:arial;"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="813" height="500"> <param name="movie" value="countdownRival.swf"> <param name="quality" value="high"> <embed src="countdownRival.swf" width="813" height="500" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed> </object> </td></tr> <tr> <td width="100"></td> <td width="300" style="background-image:url(emailaddrival.jpg);background-repeat: no-repeat;padding-left:280px;padding-top:4px;" align="center" valign="top"> <form action="" method="post" onSubmit="return checkEmail(this)"> <input name="email" type="text" value="ENTER YOUR EMAIL" size="27" style="border: solid 1px #2f2f2f;background-color:black;color:white;font-size:11px;"> <input type="image" src="http://www.lifevstyle.com/submit.jpg" align="top" name="Submit" value="submit"> </form> </td> <td width="100"></td> </tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><font style=\'color:red;\'>address:</font> 225 Hudson Street New York,NY 10013 <font style=\'color:red;\'>phone number:</font> 212-929-7222 <font style=\'color:red;\'>email:</font> [email protected]. </td></tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><a href="http://www.myspace.com/rivalllc" style=\'color:red;\'>Rival Myspace</a></td></tr> </table> </body> </html>'; $end_source= file_get_contents("http://www.lifevstyle.com/rivalnyc/"); //compare md5 $start_source2 = md5($start_source); $end_source2 = md5($end_source); if ( $start_source2 == $end_source2 ){ echo "they are the same"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-391079 Share on other sites More sharing options...
pkSML Posted November 14, 2007 Share Posted November 14, 2007 Why don't you put the source from the site in a file. Then perform md5(file_get_contents("./source.txt")) and compare it to md5(file_get_contents("http://www.lifevstyle.com/rivalnyc/")) See what happens then. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-391769 Share on other sites More sharing options...
youngvet1 Posted November 17, 2007 Author Share Posted November 17, 2007 nope still no luck. Any thoughts Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-393341 Share on other sites More sharing options...
Orio Posted November 17, 2007 Share Posted November 17, 2007 On a side note- instead of md5(file_get_contents(...)) you can simply use md5_file(). I bet the problem is line breaks... And since line breaks do not effect the source (unless you use <pre >), you can remove all the line-breaks and then compare: <?php /////////////////////////////////////////////////////////////////////////////////////////////////// $start_source='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="generator" content="Adobe GoLive" /> <title>Rival NYC</title> <style type="text/css"> @import url(style.css); </style> <SCRIPT LANGUAGE="JavaScript"> function checkEmail(myForm) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){ return (true) } alert("Invalid E-mail Address! Please re-enter.") return (false) } </script> </head> <body bgcolor="#000000"> <table cellspacing="0" cellpadding="0" border="0" align="center"> <tr><td colspan="3" style="font-family:arial;"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="813" height="500"> <param name="movie" value="countdownRival.swf"> <param name="quality" value="high"> <embed src="countdownRival.swf" width="813" height="500" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed> </object> </td></tr> <tr> <td width="100"></td> <td width="300" style="background-image:url(emailaddrival.jpg);background-repeat: no-repeat;padding-left:280px;padding-top:4px;" align="center" valign="top"> <form action="" method="post" onSubmit="return checkEmail(this)"> <input name="email" type="text" value="ENTER YOUR EMAIL" size="27" style="border: solid 1px #2f2f2f;background-color:black;color:white;font-size:11px;"> <input type="image" src="http://www.lifevstyle.com/submit.jpg" align="top" name="Submit" value="submit"> </form> </td> <td width="100"></td> </tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><font style=\'color:red;\'>address:</font> 225 Hudson Street New York,NY 10013 <font style=\'color:red;\'>phone number:</font> 212-929-7222 <font style=\'color:red;\'>email:</font> [email protected]. </td></tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><a href="http://www.myspace.com/rivalllc" style=\'color:red;\'>Rival Myspace</a></td></tr> </table> </body> </html>'; $start_source = str_replace(array("\n", "\r"), "", $start_source); $end_source = str_replace(array("\n", "\r"), "", file_get_contents("http://www.lifevstyle.com/rivalnyc/"); //compare md5 $start_source2 = md5($start_source); $end_source2 = md5($end_source); if ( $start_source2 == $end_source2 ){ echo "they are the same"; } ?> Orio. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-393360 Share on other sites More sharing options...
pkSML Posted November 17, 2007 Share Posted November 17, 2007 I tried this and it worked perfectly. This script will see if there were any changes --> http://code-bin.homedns.org/61 Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-393394 Share on other sites More sharing options...
youngvet1 Posted November 18, 2007 Author Share Posted November 18, 2007 I tried this and it worked perfectly. This script will see if there were any changes --> http://code-bin.homedns.org/61 I tried this and the out put I get is: Filesize of URL: 2478 Md5 of URL: 3c3cdd8df4c3c0314def598ace9af0a0 Md5 of file: bbe273180da4f213e831e5fa91878839 They don't match. ---- I used your exact code but created a txt document that has exact cut and paste of when I view source of that page. url.txt has exactly <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="generator" content="Adobe GoLive" /> <title>Rival NYC</title> <style type="text/css"> @import url(style.css); </style> <SCRIPT LANGUAGE="JavaScript"> function checkEmail(myForm) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){ return (true) } alert("Invalid E-mail Address! Please re-enter.") return (false) } </script> </head> <body bgcolor="#000000"> <table cellspacing="0" cellpadding="0" border="0" align="center"> <tr><td colspan="3" style="font-family:arial;"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="813" height="500"> <param name="movie" value="countdownRival.swf"> <param name="quality" value="high"> <embed src="countdownRival.swf" width="813" height="500" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed> </object> </td></tr> <tr> <td width="100"></td> <td width="300" style="background-image:url(emailaddrival.jpg);background-repeat: no-repeat;padding-left:280px;padding-top:4px;" align="center" valign="top"> <form action="" method="post" onSubmit="return checkEmail(this)"> <input name="email" type="text" value="ENTER YOUR EMAIL" size="27" style="border: solid 1px #2f2f2f;background-color:black;color:white;font-size:11px;"> <input type="image" src="http://www.lifevstyle.com/submit.jpg" align="top" name="Submit" value="submit"> </form> </td> <td width="100"></td> </tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><font style='color:red;'>address:</font> 225 Hudson Street New York,NY 10013 <font style='color:red;'>phone number:</font> 212-929-7222 <font style='color:red;'>email:</font> [email protected]. </td></tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><a href="http://www.myspace.com/rivalllc" style='color:red;'>Rival Myspace</a></td></tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-393773 Share on other sites More sharing options...
Orio Posted November 18, 2007 Share Posted November 18, 2007 Tried my code? Orio. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-393801 Share on other sites More sharing options...
pkSML Posted November 18, 2007 Share Posted November 18, 2007 That's very strange. Here's what I get: Filesize of URL: 2478 Md5 of URL: 3c3cdd8df4c3c0314def598ace9af0a0 Md5 of file: 3c3cdd8df4c3c0314def598ace9af0a0 They match! Delete your url.txt and re-run the script. Do you get what I get? Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-393857 Share on other sites More sharing options...
pkSML Posted November 18, 2007 Share Posted November 18, 2007 Filesize of URL: 2478 Md5 of URL: 3c3cdd8df4c3c0314def598ace9af0a0 This is what you got (from your last post) and it matches mine. So you just have an old url.txt. Delete it and re-run the script, and you should be good to go. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-393866 Share on other sites More sharing options...
youngvet1 Posted November 19, 2007 Author Share Posted November 19, 2007 Filesize of URL: 2478 Md5 of URL: 3c3cdd8df4c3c0314def598ace9af0a0 This is what you got (from your last post) and it matches mine. So you just have an old url.txt. Delete it and re-run the script, and you should be good to go. becuase I am using php 4 I get an error if url.txt doesnt exist. I get: Filesize of URL: 2478 Md5 of URL: 3c3cdd8df4c3c0314def598ace9af0a0 Fatal error: Call to undefined function: file_put_contents() in / .... on line 6 Why do u think when I create the file and then copy and paste the pages source code in there it returns what I previously posted and they dont match. When it gets written to url.txt(when url.txt doesnt exist) -- when u view it what shows up? Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-394265 Share on other sites More sharing options...
youngvet1 Posted November 19, 2007 Author Share Posted November 19, 2007 On a side note- instead of md5(file_get_contents(...)) you can simply use md5_file(). I bet the problem is line breaks... And since line breaks do not effect the source (unless you use <pre >), you can remove all the line-breaks and then compare: <?php /////////////////////////////////////////////////////////////////////////////////////////////////// $start_source='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="generator" content="Adobe GoLive" /> <title>Rival NYC</title> <style type="text/css"> @import url(style.css); </style> <SCRIPT LANGUAGE="JavaScript"> function checkEmail(myForm) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){ return (true) } alert("Invalid E-mail Address! Please re-enter.") return (false) } </script> </head> <body bgcolor="#000000"> <table cellspacing="0" cellpadding="0" border="0" align="center"> <tr><td colspan="3" style="font-family:arial;"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="813" height="500"> <param name="movie" value="countdownRival.swf"> <param name="quality" value="high"> <embed src="countdownRival.swf" width="813" height="500" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed> </object> </td></tr> <tr> <td width="100"></td> <td width="300" style="background-image:url(emailaddrival.jpg);background-repeat: no-repeat;padding-left:280px;padding-top:4px;" align="center" valign="top"> <form action="" method="post" onSubmit="return checkEmail(this)"> <input name="email" type="text" value="ENTER YOUR EMAIL" size="27" style="border: solid 1px #2f2f2f;background-color:black;color:white;font-size:11px;"> <input type="image" src="http://www.lifevstyle.com/submit.jpg" align="top" name="Submit" value="submit"> </form> </td> <td width="100"></td> </tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><font style=\'color:red;\'>address:</font> 225 Hudson Street New York,NY 10013 <font style=\'color:red;\'>phone number:</font> 212-929-7222 <font style=\'color:red;\'>email:</font> [email protected]. </td></tr> <tr><td style="color:white;font-size:12px;font-family:Arial;padding:10px;" align="center" colspan="5"><a href="http://www.myspace.com/rivalllc" style=\'color:red;\'>Rival Myspace</a></td></tr> </table> </body> </html>'; $start_source = str_replace(array("\n", "\r"), "", $start_source); $end_source = str_replace(array("\n", "\r"), "", file_get_contents("http://www.lifevstyle.com/rivalnyc/"); //compare md5 $start_source2 = md5($start_source); $end_source2 = md5($end_source); if ( $start_source2 == $end_source2 ){ echo "they are the same"; } ?> Orio. ok this worked Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-394269 Share on other sites More sharing options...
pkSML Posted November 19, 2007 Share Posted November 19, 2007 becuase I am using php 4 I get an error if url.txt doesnt exist. I get: Filesize of URL: 2478 Md5 of URL: 3c3cdd8df4c3c0314def598ace9af0a0 Fatal error: Call to undefined function: file_put_contents() in / .... on line 6 Why do u think when I create the file and then copy and paste the pages source code in there it returns what I previously posted and they dont match. When it gets written to url.txt(when url.txt doesnt exist) -- when u view it what shows up? I have PHP5. File_put_contents must be a PHP5 command. Your problems are probably related to line breaks when you copy the code. If you forget just one of them (there may be extras at the end of the file), it won't match. But I see you got it working! That's great. Quote Link to comment https://forums.phpfreaks.com/topic/76951-code-to-check-if-html-source-has-changed/#findComment-394402 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.