-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexample.test.php
41 lines (27 loc) · 1.36 KB
/
example.test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php //error_reporting(0);
/* Set location your class exist ( Recomended )
! Replace it with your setting's
( this only Sample ), example, like this :
*/
define('DS', DIRECTORY_SEPARATOR);
define('APP_BASE', dirname(__FILE__).DS);
define('CLASS_DIR', APP_BASE.'class'.DS);
define('DATA_DIR', APP_BASE.'data'.DS);
//------------------------------------------------------
// Get the class and Set Whois data
require CLASS_DIR.'class_domain.php'; // '../class/class_domain.php';
$check_domain = new Domain_Checker;
$check_domain->WHOIS_FILE = DATA_DIR.'whois_server.php'; // '../data/whois_server.php';
// ------------------------------------------------------
// Handle user's request
if( isset($_GET['domainname']) && !empty ($_GET['domainname']) ) {
$domainsearch = preg_replace('/http:\/\/(.*?)*\.com/', '', $_GET['domainname']);
$is_available = $check_domain->cek_available_domain($domainsearch);
}
// Search Form Example
$domain_cek_form = '<div align="center"><h1>'.( isset($is_available) ? ( $is_available ? $domainsearch.' available' : $domainsearch.' not available' ) : 'Check your domain' ).'</h1>
<form method="GET">
<input type="text" name="domainname" placeholder="example: yourdomain.com" required/>
<input type="submit" value="GO"/>
</form></div>';
echo($domain_cek_form);