简体   繁体   中英

dns_get_record using post from form

I am trying to create a simple DNS query based on dns_get_record. I have scoured the internet for support on this but to no avail! Most likely because it is an old and outdated method. Nevertheless, I am having a hard time getting a form to work with the php. Any help would be appreciated.

index.html

<html>
<body>

<form action="dns.php" method="post">
Name: <input type="text" name="search"><br>
<input type="submit">
</form>

</body>
</html>

dns.php

<?php
$search = test_input($_POST["search"]);
$result = dns_get_record($search, DNS_ANY, $authns, $addtl);
echo "Result = ";
print_r($result);
echo "Auth NS = ";
print_r($authns);
echo "Additional = ";
print_r($addtl);
?>

您是否尝试过不带test_input函数?

$search = $_POST["search"];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM