加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xml – 服务器名称或地址无法解析,为什么?

发布时间:2020-12-16 23:27:58 所属栏目:百科 来源:网络整理
导读:我在我的asp页面(www.test1.com)中使用下面的代码 url= "http://www.test1.com/test.asp" dim http,pxml,http_response set http = server.CreateObject("MSXML2.ServerXMLHTTP.3.0") http.open "GET",url,0 http.setrequestheader "content-type","text/xml
我在我的asp页面(www.test1.com)中使用下面的代码

url= "http://www.test1.com/test.asp"
    dim http,pxml,http_response
    set http = server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
    http.open "GET",url,0
    http.setrequestheader "content-type","text/xml; charset=utf-8"
    http.send ""

但我在我的页面中得到错误,如下所示

msxml3.dll error '80072ee7'

The server name or address could not be resolved

但我发送requet到同一服务器(http://www.test1.com)只有问题.但我发送请求到任何其他服务器,如(http://www.test2.com)工作正常

为什么同一台服务器出现问题?

解决方法

可能是您的Web服务器的DNS没有列出自己的名称(是的,它会发生!),所以请尝试使用“localhost”或“127.0.0.1”.

如果您在此服务器上安装/启用了PHP,则可以快速查看它可以解析的服务器名称:

<?php

function test() {
    $hostname = isset($_POST['hostname']) ? trim($_POST['hostname']) : false;

    if ($hostname) {
        echo "<h2>Hostname: ",htmlspecialchars($hostname),"</h2>n";

        if ($addrs = gethostbynamel($hostname)) {
            echo "<div>n";
            var_dump($addrs);
            echo "</div>n";
        }
        else {
            echo "<p>No records found.</p>n";
        }
    }
}

?>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Test DNS record retrieval</title>
</head>

<body>
<h1>Test DNS record retrieval</h1>
<?php test(); ?>

<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
    <table>
        <tr>
            <th>host name:</th>
            <td><input type="text" tabindex="10" name="hostname" size="40" ></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" tabindex="99"></td>
        </tr>
    </table>
</form>

</body>
</html>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读