cha0sriderx Posted November 5, 2007 Share Posted November 5, 2007 i wanted to connect to another site(nittolegends.com) get find out the newest version of the game that is out. the page i want to check is http://www.nittolegends.com/download_sites.aspx and search for the text a href="http://download.nittolegends.com/NittoLegendsBeta0990.exe" <?php function checkversion($d_vlegends) { $host = "www.nittolegends.com"; $page = "/download_sites.aspx"; $fp = fsockopen($host, 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET $page HTTP/1.1\r\n"; $out .= "Host: ".$host."\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $line = fgets($fp, 128); $do = preg_match("/<a href=(.*)download.nittolegends.com(.*)\">/", $line, $matches); if ($do == "true") { $str = str_replace("/NittoLegendsBeta", "", $matches[3]); $str = str_replace(".exe\"", "", $str); if ($d_vlegends < $str) { return $str; } } } fclose($fp); } return "false"; } ?> Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 5, 2007 Share Posted November 5, 2007 you have the code and the explanation but wheres the question there? Quote Link to comment Share on other sites More sharing options...
cha0sriderx Posted November 5, 2007 Author Share Posted November 5, 2007 the question was where is the bug...it was working the other day and then i come back and check it again and it stopped working. Quote Link to comment 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.