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...