Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * test17476.php
4
 * 09-Jun-2010
5
 *
6
 * PHP Version 5
7
 *
8
 * @category test17476
9
 * @package  test17476
10
 * @author   Ken Guest <ken.guest@blacknight.com>
11
 * @license  GPL (see http://www.gnu.org/licenses/gpl.txt)
12
 * @version  CVS: <cvs_id>
13
 * @link     test17476.php
14
 * @todo
15
*/
16
 
17
 
18
 
19
?>
20
<?php
21
$q=isset($_REQUEST['q'])?htmlspecialchars($_REQUEST['q']):NULL;
22
$s=isset($_REQUEST['s'])?htmlspecialchars($_REQUEST['s']):NULL;
23
$q = 'test.com';
24
if (strchr($q,'.')) {
25
    require_once "Net/Whois.php";
26
    $whois = new Net_Whois;
27
    $q=strtolower($q);
28
    if (!$s && $q[0] == '.') {
29
        $s='whois.iana.org';
30
    }
31
    $q=trim($q,'.');
32
    $tld=pathinfo($q,PATHINFO_EXTENSION);
33
    if ($tld=='com') {
34
        $whois->setAuthoritative(1);
35
    } elseif ($tld=='name') {
36
        $q='domain = '.$q;
37
    }
38
    $data=htmlspecialchars($whois->query($q,$s));
39
    echo "<pre>$data</pre>";
40
}
41
?>