Доброго времени суток, есть вот такой код: PHP: <?phperror_reporting(E_ALL);$stat_mas = array("<small>»", "</small>");$login_mas = array("<h4>", "<i class=></i>");$pos_mas = array("Город: <a>", "</a>");$level_mas = array("Боевой уровень: <b>", "</b>");$cur_helth_mas = array("id=\"curr_helth_val\">", "</span>");$helth_mas = array("class=\"health\">/", "</span>");function get_page($url, $post_data) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($curl, CURLOPT_GET, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36"); $content = curl_exec($curl); curl_close($curl); return $content;}function modify_link($str) { if (strpos($str, "a href=")) { $tmp = explode('"', $str); return $tmp[0].'"'.'http://www.icedland.ru/'.$tmp[1].'"'.$tmp[2]; } return $str;}function get_value_from_page($cont, $str_beg, $str_end, $offset = 0) { $pos_begin = strpos($cont, $str_beg); $pos_end = strpos($cont, $str_end, $pos_begin); $out = substr($cont, $pos_begin + strlen($str_beg) + $offset, $pos_end - ($pos_begin + strlen($str_beg) + $offset) ); return $out;}if ( isset($_GET['set']) ) { print " <form action='onlineSMG.php' method='post'> <textarea name='post'> </textarea> <input type='submit'> </form> "; die;}if ( isset($_POST['post']) ) { //print var_dump($_POST); die; $text = $_POST['post']; //print $text; die; $b = 1; $e = 1; //$f = fopen('tt', "a+"); //if (!$f) { // print "not open file"; // die; //} while ($b and $e) { $b = strpos($text, "<a href='", $e); $e = strpos($text, "'>", $b); if ($b and $e) { $link = 'http://www.icedland.ru'.substr($text, $b + strlen("<a href='"), $e - ($b + strlen("<a href='")) ); $content = get_page($link, ''); $level = get_value_from_page($content, $level_mas[0], $level_mas[1]); if ($level >= 30) //fwrite($f, $link."\n"); //file_put_contents('tt', $link."\n"); print $link."<br>"; } } //fclose($f); die;}$urls = file('listSMG.txt'); //'http://www.icedland.ru/humaninfo.php?id=194376'; print "<html> <head> <title>Online SMG</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\"> </head><body><style> body { font-family: Verdana, Arial Narrow, Arial; font-size: 16px; } #red { color : red; } a { text-decoration: underline; color : blue; } a:hover { text-decoration: underline; } #blue { color : blue; } </style><table cellspacing='0' cellpadding='5'> <tr> <th>Login</th> <th>Status</th> <th>Position</th> </tr>";for ($i = 0; $i < sizeof($urls); $i++) { $content = get_page($urls[$i], ''); $status = modify_link(get_value_from_page($content, $stat_mas[1])); $login = modify_link(get_value_from_page($content, $login_mas[1])); $pos = strip_tags(get_value_from_page($content, $pos_mas[0], $pos_mas[1])); $level = get_value_from_page($content, $level_mas[0], $level_mas[1]); $cur_helth = get_value_from_page($content, $cur_helth_mas[0], $cur_helth_mas[1]); $helth = get_value_from_page($content, $helth_mas[0], $helth_mas[1]); if ($cur_helth >= ($helth * 0.6)) $cur = 'blue'; else $cur = 'red'; if (($status == 'Персонаж в игре') or (strpos($status, 'В бою') != FALSE) or ($status == 'В заявке на бой') ) { print " <tr> <td><a href='{$urls[$i]}'><span ID='$cur'><b>{$login} [{$level}]</b> [{$cur_helth}/{$helth}]</span></a></td> <td><span ID='$cur'>{$status}</span></td> <td>{$pos}</td> </tr> "; }}print "</table></body></html>";?> Суть кода опрашивать список url из файла ListSMG.txt по типу http://www.icedland.ru/humaninfo.php?id=194376 раньше работало все прекрасно, но в какой то момент перестало, помогите/направьте где искать ошибку
PHP: <?phperror_reporting(E_ALL);$stat_mas = array("<small>»", "</small>");$login_mas = array("<h4>", "<i class=");$pos_mas = array("Город: ", "</a>");$level_mas = array("Боевой уровень: <b", "</b>");$cur_helth_mas = array("id=\"curr_helth_val\">", "</span>");$helth_mas = array("class=\"health\"> /", "</span>");function get_page($url, $post_data) { $curl = curl_init(trim($url)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($curl, CURLOPT_GET, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36"); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); $content = curl_exec($curl); curl_close($curl); return $content;}function modify_link($str) { if (strpos($str, "a href=")) { $tmp = explode('"', $str); return $tmp[0].'"'.'http://www.icedland.ru/'.$tmp[1].'"'.$tmp[2]; } return trim($str);}function get_value_from_page($cont, $str_beg, $str_end, $offset = 0) { $pos_begin = strpos($cont, $str_beg); $pos_end = strpos($cont, $str_end, $pos_begin); $out = substr($cont, $pos_begin + strlen($str_beg) + $offset, $pos_end - ($pos_begin + strlen($str_beg) + $offset) ); return $out;}if ( isset($_GET['set']) ) { print " <form action='onlineSMG.php' method='post'> <textarea name='post'> </textarea> <input type='submit'> </form> "; die;}if ( isset($_POST['post']) ) { //print var_dump($_POST); die; $text = $_POST['post']; //print $text; die; $b = 1; $e = 1; //$f = fopen('tt', "a+"); //if (!$f) { // print "not open file"; // die; //} while ($b and $e) { $b = strpos($text, "<a href='", $e); $e = strpos($text, "'>", $b); if ($b and $e) { $link = 'http://www.icedland.ru'.substr($text, $b + strlen("<a href='"), $e - ($b + strlen("<a href='")) ); $content = get_page($link, ''); $level = get_value_from_page($content, $level_mas[0], $level_mas[1]); if ($level >= 30) //fwrite($f, $link."\n"); //file_put_contents('tt', $link."\n"); print $link."<br>"; } } //fclose($f); die;}$urls = file('listSMG.txt'); //'http://www.icedland.ru/humaninfo.php?id=194376';print "<html> <head> <title>Online SMG</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\"> </head><body><style> body { font-family: Verdana, Arial Narrow, Arial; font-size: 16px; } #red { color : red; } a { text-decoration: underline; color : blue; } a:hover { text-decoration: underline; } #blue { color : blue; }</style><table cellspacing='0' cellpadding='5'> <tr> <th>Login</th> <th>Status</th> <th>Position</th> </tr>";for ($i = 0; $i < sizeof($urls); $i++) { $content = get_page($urls[$i], ''); $status = modify_link(get_value_from_page($content, $stat_mas[0], $stat_mas[1])); $login = modify_link(get_value_from_page($content, $login_mas[0], $login_mas[1])); $pos = strip_tags(get_value_from_page($content, $pos_mas[0], $pos_mas[1])); $level = preg_replace('/[^0-9]/', '', get_value_from_page($content, $level_mas[0], $level_mas[1])); $cur_helth = get_value_from_page($content, $cur_helth_mas[0], $cur_helth_mas[1]); $helth = get_value_from_page($content, $helth_mas[0], $helth_mas[1]); if ($cur_helth >= ($helth * 0.6)) $cur = 'blue'; else $cur = 'red'; if (($status == 'Персонаж в игре') or (strpos($status, 'В бою') != FALSE) or ($status == 'В заявке на бой') ) { print " <tr> <td><a href='{$urls[$i]}'><span ID='$cur'><b>{$login} [{$level}]</b> [{$cur_helth}/{$helth}]</span></a></td> <td><span ID='$cur'>{$status}</span></td> <td>{$pos}</td> </tr> "; }}print "</table></body></html>";?>