Есть такой кароче скрипт, который берёт инфу с хуиз-сервера, но каким макаром можно получить не все данные а только некоторые-например name server,expiration date .... <?php include($_SERVER['DOCUMENT_ROOT']."/whois_class/server_list.php"); include($_SERVER['DOCUMENT_ROOT']."/whois_class/whois_class.php"); // error_reporting(E_ALL); $my_whois = new Whois_domain; $my_whois->possible_tlds = array_keys($servers); // this is the array from the included server list if (isset($_POST['submit'])) { $my_whois->tld = $_POST['tld']; <?php include($_SERVER['DOCUMENT_ROOT']."/whois_class/server_list.php"); include($_SERVER['DOCUMENT_ROOT']."/whois_class/whois_class.php"); // error_reporting(E_ALL); $my_whois = new Whois_domain; $my_whois->possible_tlds = array_keys($servers); // this is the array from the included server list if (isset($_POST['submit'])) { $my_whois->tld = $_POST['tld']; $my_whois->domain = $_POST['domain']; $my_whois->free_string = $servers[$_POST['tld']]['free']; $my_whois->whois_server = $servers[$_POST['tld']]['address']; $my_whois->whois_param = $servers[$_POST['tld']]['param']; $my_whois->full_info = (isset($_POST['all_info'])) ? $_POST['all_info'] : "no"; // between "no" and "yes" to get all whois information $my_whois->process(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Whois class example</title> </head> <body> <h2>Whois domain name check</h2> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form"> <input type="text" name="domain" size="14" maxlength="63" value="<?php echo (isset($_POST['domain'])) ? $_POS T['domain'] : ""; ?>"> <?php echo $my_whois->create_tld_select(); // this method generates the select menu woth all tld's ?> <br> Show all info?<input name="all_info" type="checkbox" value="yes"> <input name="submit" type="submit" value="Whois"> </form> <p><?php echo ($my_whois->msg != "") ? $my_whois->msg : ""; ?></p> <!-- this will show up all info from the whois server --> <?php if ($my_whois->info != "") { ?> <h2><?php echo "Whois ".$my_whois->compl_domain."?" ?></h2> <blockquote> <?php echo nl2br($my_whois->info); ?> </blockquote> <?php } ?> </body> </html>
не ну Hight раз такой умный модератор, то типа протести вышеуказанный скрипт и помогай.... в чём прикол, а я уже посмотрю на резалты твоего джоба и обеспечу тибе нестабильный коннект maybe....
L, есть предложение: 1. исправить мнение в отношении Hight 2. исправить приведенный код 3. разобраться в whois_class.php, профессионально скрытом от наших глаз includ-ом.
ага, бежим и спотыкаемся. а server_list.php и whois_class.php мы сами должны написать? :lol: понакачают чужих скриптов... кури регулярки.
server_list.php <?php // this ist list with servers which are used with this class // info about the values for the key "free": // this is the string (answer) what the server returns if there is no match. // the value's for the key 'param' is mostly empty. I you have some suggestions for diff. // whois servers, then let me know... $servers['com']['address'] = "whois.crsnic.net"; $servers['com']['free'] = "No match for"; $servers['com']['param'] = ""; $servers['net']['address'] = "whois.crsnic.net"; $servers['net']['free'] = "No match for"; $servers['net']['param'] = ""; $servers['org']['address'] = "whois.pir.org"; $servers['org']['free'] = "NOT FOUND"; $servers['org']['param'] = ""; $servers['ru']['address'] = "whois.ripn.net"; $servers['ru']['free'] = "NOT FOUND"; $servers['ru']['param'] = ""; $servers['ua']['address'] = "whois.net.ua"; $servers['ua']['free'] = "NOT FOUND"; $servers['ua']['param'] = ""; // add here more servers if you like ?> whois_class.php <?php class Whois_domain { var $possible_tlds; var $whois_server; var $free_string; var $whois_param; var $domain; var $tld; var $compl_domain; var $full_info; var $msg; var $info; var $os_system = "linux"; // switch between "linux" and "win" function Whois_domain() { $this->info = ""; $this->msg = ""; } function process() { if ($this->create_domain()) { if ($this->full_info == "yes") { $this->get_domain_info(); } else { if ($this->check_only() == 1) { $this->msg = "The domain name: <b>".$this->compl_domain."</b> is free."; return true; } elseif ($this->check_only() == 0) { $this->msg = "The domain name: <b>".$this->compl_domain."</b> is register ed"; return false; } else { $this->msg = "There was something wrong, try it agian."; } } } else { $this->msg = "Only letters, numbers and hyphens (-) are valid!"; } } function check_entry() { if (preg_match("/^([A-Za-z0-9]+(\-?[A-za-z0-9]*)){2,63}$/", $this->domain)) { return true; } else { return false; } } function create_tld_select() { $menu = "<select name=\"tld\" style=\"margin-left:0;\">\n"; foreach ($this->possible_tlds as $val) { $menu .= " <option value=\"".$val."\""; $menu .= (isset($_POST['tld']) && $_POST['tld'] == $val) ? " selected>" : ">"; $menu .= $val."\n"; } $menu .= "</select>\n"; return $menu; } function create_domain() { if ($this->check_entry()) { $this->domain = strtolower($this->domain); $this->compl_domain = $this->domain.".".$this->tld; return true; } else { return false; } } function check_only() { $data = $this->get_whois_data(); if (is_array($data)) { $found = 0; foreach ($data as $val) { if (eregi($this->free_string, $val)) { $found = 1; } } return $found; } else { $this->msg = "Error, please try it again."; } } function get_domain_info() { if ($this->create_domain()) { $data = ($this->tld == "nl") ? $this->get_whois_data(true) : $this->get_whois_data(); if (is_array($data)) { foreach ($data as $val) { if (eregi($this->free_string, $val)) { $this->msg = "The domain name: <b>".$this->compl_domain."</b> is free."; $this->info = ""; break; } $this->info .= $val; } } else { $this->msg = "Error, please try it again."; } } else { $this->msg = "Only letters, numbers and hyphens (-) are valid!"; } } function get_whois_data($empty_param = false) { // the parameter is new since version 1.20 and is used for .nl (dutch) domains only if ($empty_param) { $this->whois_param = ""; } if ($this->tld == "de") $this->os_system = "win"; // this tld must be queried with fsock otherwis e it will not work if ($this->os_system == "win") { $connection = @fsockopen($this->whois_server, 43); if (!$connection) { unset($connection); $this->msg = "Can't connect to the server!"; return; } else { sleep(2); fputs($connection, $this->whois_param.$this->compl_domain."\r\n"); while (!feof($connection)) { $buffer[] = fgets($connection, 4096); } fclose($connection); } } else { $string = "whois -h ".$this->whois_server." \"".$this->whois_param.$this->compl_domain."\ ""; exec($string, $buffer); } if (isset($buffer)) { //print_r($buffer); return $buffer; } else { $this->msg = "Can't retrieve data from the server!"; } } } ?>
Ну, а что тут непонятного-то? Ты получаешь текст. Так? Вырезать надо определенные строки. Так? Строки все типа "Что" - "Чему равно"..
L за 25 рэ + 2 пустые бутылки - вы имеете право пойти совершить долгосрочное "сексуальное путишествие"..... кури мануал!
Все очень любят регулярки, при этом забывая куда более простые и приятные функции, как например explode().