检查 PHP 脚本中的域和名称服务器未按预期工作

问题描述 投票:0回答:1
javascript php html regex http-redirect
1个回答
0
投票

您的代码仅在出现“自定义”一词时才有效,因为您添加了这样做的条件!

$domain = $_POST['domain'];
if ($domain === 'custom') {
  $domain = $_POST['customDomain'];
}
if ($domain === 'custom') {
  $dnsRecords = dns_get_record($domain, DNS_NS);
  // rest of the code
  }

鉴于此,当用户选择自定义域时,您期望收到字符串

'custom'

您可以删除条件或将“自定义”一词添加到获取的正文中

'domain=custom_' + encodeURIComponent(domain)
每个域,代码将按预期工作

© www.soinside.com 2019 - 2024. All rights reserved.