午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    wordpress使用郵件追蹤404頁(yè)面
    來(lái)源:易賢網(wǎng) 閱讀:1125 次 日期:2016-06-28 11:10:02
    溫馨提示:易賢網(wǎng)小編為您整理了“wordpress使用郵件追蹤404頁(yè)面”,方便廣大網(wǎng)友查閱!

    作為一個(gè)有意識(shí)的web開(kāi)發(fā)者/網(wǎng)站的所有者,你可能想跟蹤您的網(wǎng)站或博客的404頁(yè)。當(dāng)然你可以分析你站點(diǎn)的訪問(wèn)日志文件,但我們今天要講的是一個(gè)更好的追蹤方式,那就是通過(guò)發(fā)送郵件報(bào)告。這樣我么就能更加及時(shí)的獲取404頁(yè)面的情況。

    如果你的主題沒(méi)有404.php文件,你必須創(chuàng)建他,然后將一下代碼添加到你的404頁(yè)面中:

    注意:使用該方法前提是你的wordpress支持郵件發(fā)送。

    // 設(shè)置頁(yè)面狀態(tài)

    header(http/1.1 404 not found);

    header(status: 404 not found);

    // 站點(diǎn)信息

    $blog = get_bloginfo('name');

    $site = get_bloginfo('url') . '/';

    $email = get_bloginfo('admin_email');

    // 主題信息

    if (!empty($_cookie[nkthemeswitch . cookiehash])) {

    $theme = clean($_cookie[nkthemeswitch . cookiehash]);

    } else {

    $theme_data = wp_get_theme();

    $theme = clean($theme_data->name);

    }

    // 獲取來(lái)源地址

    if (isset($_server['http_referer'])) {

    $referer = clean($_server['http_referer']);

    } else {

    $referer = undefined;

    }

    // 來(lái)源 uri

    if (isset($_server['request_uri']) && isset($_server[http_host])) {

    $request = clean('http://' . $_server[http_host] . $_server[request_uri]);

    } else {

    $request = undefined;

    }

    // 查詢字符串

    if (isset($_server['query_string'])) {

    $string = clean($_server['query_string']);

    } else {

    $string = undefined;

    }

    // ip 地址

    if (isset($_server['remote_addr'])) {

    $address = clean($_server['remote_addr']);

    } else {

    $address = undefined;

    }

    // 用戶客戶端信息 agent

    if (isset($_server['http_user_agent'])) {

    $agent = clean($_server['http_user_agent']);

    } else {

    $agent = undefined;

    }

    // 用戶連接協(xié)議

    if (isset($_server['remote_ident'])) {

    $remote = clean($_server['remote_ident']);

    } else {

    $remote = undefined;

    }

    // 記錄時(shí)間

    $time = clean(date(y-m-d h:i:s, time()));

    // 組合信息

    function clean($string) {

    $string = rtrim($string);

    $string = ltrim($string);

    $string = htmlentities($string, ent_quotes);

    $string = str_replace(n, 

    , $string);

    if (get_magic_quotes_gpc()) {

    $string = stripslashes($string);

    }

    return $string;

    }

    $message =

    time: . $time . n .

    *404: . $request . n .

    site: . $site . n .

    theme: . $theme . n .

    referrer: . $referer . n .

    query string: . $string . n .

    remote address: . $address . n .

    remote identity: . $remote . n .

    user agent: . $agent . nnn;

    // 發(fā)送郵件

    mail($email, 404 alert: . $blog . [ . $theme . ], $message, from: $email);

    ?>

    更多信息請(qǐng)查看CMS教程
    易賢網(wǎng)手機(jī)網(wǎng)站地址:wordpress使用郵件追蹤404頁(yè)面
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
    相關(guān)閱讀CMS教程

    2025國(guó)考·省考課程試聽(tīng)報(bào)名

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)