我有一个视频网站,我需要创建一个链接或按钮,以便访问者可以单击报告损坏的链接。
我试图包括REQUEST_URI
但到目前为止没有成功。URL 永远不会显示。这是report.php的内容:
<?php
$to = 'admin@domain';
$subject = 'domain.com Broken Link';
$message = '
<html>
<head>
<title>Dead Link from domain.com</title>
</head>
<body>
<p>The website contains a DEAD LINK</p>
<p>Please fix or remove the faulty file or page.</p>
<?php
function url_origin( $s, $use_forwarded_host = false )
{
$ssl = ( ! empty( $s['HTTPS'] ) && $s['HTTPS'] == 'on' );
$sp = strtolower( $s['SERVER_PROTOCOL'] );
$protocol = substr( $sp, 0, strpos( $sp, '/' ) ) . ( ( $ssl ) ? 's' : '' );
$port = $s['SERVER_PORT'];
$port = ( ( ! $ssl && $port=='80' ) || ( $ssl && $port=='443' ) ) ? '' : ':'.$port;
$host = ( $use_forwarded_host && isset( $s['HTTP_X_FORWARDED_HOST'] ) ) ? $s['HTTP_X_FORWARDED_HOST'] : ( isset( $s['HTTP_HOST'] ) ? $s['HTTP_HOST'] : null );
$host = isset( $host ) ? $host : $s['SERVER_NAME'] . $port;
return $protocol . '://' . $host;
}
function full_url( $s, $use_forwarded_host = false )
{
return url_origin( $s, $use_forwarded_host ) . $s['REQUEST_URI'];
}
$absolute_url = full_url( $_SERVER );
echo $absolute_url;
?>
</body>
</html>';
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';
mail($to, $subject, $message, implode("\r\n", $headers));
echo ("The report has been sent.<br>Thank you for your time.");
?>