directory_submit.php

来自「php源码 php源码参考」· PHP 代码 · 共 53 行

PHP
53
字号
<html>
<head>
  <title>Site submission results</title>
</head>
<body>
<h1>Site submission results</h1>
<?php

  // Extract form fields

  $url = $_REQUEST['url'];
  $email = $_REQUEST['email'];

  // Check the URL

  $url = parse_url($url);
  $host = $url['host'];
  if(!($ip = gethostbyname($host)))
  {
    echo 'Host for URL does not have valid IP';
    exit;
  }

  echo "Host is at IP $ip <br>";  

  // Check the email address

  $email = explode('@', $email);
  $emailhost = $email[1];

  // note that the getmxrr() function is *not implemented* in 
  // Windows versions of PHP
  if (!getmxrr($emailhost, $mxhostsarr))
  {
    echo 'Email address is not at valid host';
    exit;   
  } 

  echo 'Email is delivered via: ';
  foreach ($mxhostsarr as $mx)
    echo "$mx "; 

  // If reached here, all ok

  echo '<br>All submitted details are ok.<br>';
  echo 'Thank you for submitting your site.<br>'
       .'It will be visited by one of our staff members soon.'  

  // In real case, add to db of waiting sites... 
?>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?