-2
我正在嘗試創建一個PHP,可以從請求中記錄HTTP信息,然後通過電子郵件發送此信息。我試圖發送IP,URL引用和URL請求)如何登錄「請求信息」然後通過電子郵件發送?
的想法是,$emailContent
可以發送:
"Someone visited your webpage. IP address:".$remoteIpAddress;
"The referrer URL from the request was:".$urlRefer
"The URL input was: php?".$infoFromUrl
$ infoFromUrl意味着發送類似log.php URL信息發送,這 - 信息,通過郵件
誰能幫助我:
<?php
$yourEmailAddress = "[email protected]domain.com";
$emailSubject = "New Visitor on Webpage";
$remoteIpAddress = $_SERVER['REMOTE_ADDR'];
$emailContent = "Someone visited your webpage. IP address:".$remoteIpAddress;
// send the message
mail($yourEmailAddress, $emailSubject, $emailContent);
?>
你的問題還不清楚,你究竟在努力達到什麼目的。你想發送日誌數據作爲電子郵件? – Kuru
是的。我想在PHP文件調用時自動發送信息。我正在調查'HTTP_REFERER' – pancho
你有一些代碼。沒有什麼是明顯的錯誤。有什麼問題? – Quentin