php--using WAN network interface to realize the function of domain name Query _php tutorial

Source: Internet
Author: User
Today to others to do the site when there is a need to have a domain name query function, check out a bit of information to write a simple query function
The front page uses a checkbox with the following code:
Copy CodeThe code is as follows:


PHP Code:
Copy CodeThe code is as follows:

Get top-level domains
$ext =$_post[' ext '];
Get a Level two domain name
$dns = $_post[' DNS '];

Print_r ($ext);
$domain = $dns. "." . $ext [0];
Echo $domain;

Traverse all the Domains
foreach ($ext as $value) {
Combined Domain name
$domain = $dns. "." . $value;

Inquire:
Echo $domain;

$do = "http://panda.www.net.cn/cgi-bin/check.cgi?area_domain=". $domain;
$xml _data = file_get_contents ($do);
$result _arr = (array) simplexml_load_string ($xml _data);

$returncode = $result _arr[' ReturnCode ');
$key = $result _arr[' key '];

$original = $result _arr[' original ');

$status = substr ($original, 0, 3);

if ($status = = "210") {

echo ": Congratulations, you can register";

}else if ($status = = "211") {

echo ": Already registered";

}else if ($status = = "212") {

echo ": Parameter Error";

}
Echo '
';

}

?>

http://www.bkjia.com/PHPjc/326229.html www.bkjia.com true http://www.bkjia.com/PHPjc/326229.html techarticle today to others to do the site when there is a need to have a domain name query function, check out a bit of information to write a simple query function front page with a checkbox, code as follows: Copy code code such as ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.