Last active
January 3, 2016 10:39
-
-
Save himajin315/8451344 to your computer and use it in GitHub Desktop.
dns_get_record を使ったサンプルコード。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<title>DNS Search</title> | |
<meta charset="UTF-8"> | |
<link ref="stylesheet" href="style.css" type="text/css"> | |
</head> | |
<body> | |
<h1>DNS Search</h1> | |
<form action="dns_get_record.php" method="get"> | |
ホスト名: <input type="text" name="host"> | |
<input type="submit" value="送信"> | |
</form> | |
<?php | |
if(isset($_GET['host'])){ | |
$host_name = $_GET['host']; | |
//DNSレコードを取得する | |
$result = dns_get_record($host_name); | |
//結果を表示 | |
if($result){ | |
echo "<pre>"; | |
print_r($result); | |
echo "</pre>"; | |
}else{ | |
echo '見つかりませんでした。'; | |
} | |
} | |
?> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment