国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

通過Email發送PHP錯誤的方法

2024-04-25 20:39:39
字體:
來源:轉載
供稿:網友

本文實例講述了通過Email發送PHP錯誤的方法。分享給大家供大家參考。具體實現方法如下:

<?php

// Our custom error handler

function nettuts_error_handler($number, $message, $file, $line, $vars){

$email = "

<p>An error ($number) occurred on line

<strong>$line</strong> and in the <strong>file: $file.</strong>

<p> $message </p>";

$email .= "<pre>" . print_r($vars, 1) . "</pre>";

$headers = 'Content-type: text/html; charset=iso-8859-1' . "/r/n";

// Email the error to someone...

error_log($email, 1, 'you@youremail.com', $headers);

// Make sure that you decide how to respond to errors (on the user's side)

// Either echo an error message, or kill the entire project. Up to you...

// The code below ensures that we only "die" if the error was more than

// just a NOTICE.

if ( ($number !== E_NOTICE) && ($number < 2048) ) {

die("There was an error. Please try again later.");

}

}

// We should use our custom function to handle errors.

set_error_handler('nettuts_error_handler');

// Trigger an error... (var doesn't exist)

echo $somevarthatdoesnotexist;

希望本文所述對大家的php程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 察雅县| 海晏县| 龙川县| 北宁市| 绥宁县| 崇州市| 凤庆县| 武邑县| 酒泉市| 洛南县| 宜川县| 高碑店市| 灵石县| 红桥区| 巴林左旗| 青阳县| 元氏县| 监利县| 嘉定区| 佳木斯市| 常熟市| 福泉市| 汕尾市| 牡丹江市| 临沧市| 左贡县| 本溪市| 光泽县| 城口县| 同德县| 台中市| 伊吾县| 泸定县| 康马县| 板桥市| 沈丘县| 太白县| 邛崃市| 永州市| 瓮安县| 安陆市|