我需要获取域信息,所以我编写了此函数
$servers = array(
"biz" => "whois.neulevel.biz",
"com" => "whois.internic.net",
function whois($domainName, $ext)
{
$server = trim($this->servers[$ext]);
$output = "";
try {
if ($conn = fsockopen($server, 43)) {
fputs($conn, strtolower($domainName) . '.' . $ext . "\r\n");
while (!feof($conn)) {
$output .= fgets($conn, 128);
}
fclose($conn);
if (stristr($output, "No match") ||
stristr($output, "No Data") ||
stristr($output, "No entries") ||
stristr($output, "No entries") ||
stristr($output, "NOT FOUND")) {
$this->durum[$ext]["durum"] = "bos";
} else {
$this->durum[$ext]["durum"] = "dolu";
// $this->durum[$ext]["son"] =substr($output)
}
$bas = strpos($output, "Expiry Date:");
$t = substr($output, $bas, 23);
$tarih = str_replace("Expiry Date:", "", $t);
$this->durum[$ext]["son"] = $tarih;
} else {
}
} catch (exception $e) {
echo $e->getMessage();
}
此功能在不使用ajax的情况下也可以正常工作问题是,如果我使用ajax,我意识到它在没有等待10或15秒的情况下无法再次运行。
这是我的ajax代码
$.ajax({
type: "POST",
url: "islem.php",
beforeSend:function(){
$('#table').html("")
$('.load').show()
},
data: {
extension:myCheckboxes,domainName:domainName },
success:function (e) {
$('#table').html(e)
}
我错过了什么吗?为什么我应该等待第二次执行