PHP -- use the HiChina interface to implement the domain name query function _ PHP Tutorial

Source: Internet
Author: User
PHP -- use the HiChina interface to implement the domain name query function. Today, when I create a website for someone else, I have to have the domain name query function. I checked some information and wrote a simple query function. the front-end page uses the checkbox function. the code is as follows: copy the code. for example, if you want to create a website for someone else today, you have to have the domain name query function. you checked the information and wrote a simple query function.
The front-end page uses checkbox and the code is as follows:

The code is as follows:




PHP code:

The code is as follows:



// Obtain the top-level domain name
$ Ext = $ _ POST ['text'];
// Obtain the second-level domain name
$ Dns =$ _ POST ['dns'];

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

// Traverse all domain names
Foreach ($ ext as $ value ){
// Domain name combination
$ Domain = $ dns. ".". $ value;

// Query:
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 ($ State = "211 "){

Echo ": registered ";

} Else if ($ State = "212 "){

Echo ": Parameter error ";

}
Echo'
';

}

?>

The front-end page of the supervisor uses checkbox. the code is as follows...

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.