国产探花免费观看_亚洲丰满少妇自慰呻吟_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程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 垫江县| 克东县| 南岸区| 锡林郭勒盟| 横峰县| 霍林郭勒市| 平南县| 县级市| 全椒县| 贞丰县| 郓城县| 普定县| 宝鸡市| 南宁市| 四川省| 吉安县| 蚌埠市| 玉树县| 铁岭市| 吉木萨尔县| 克拉玛依市| 元谋县| 察隅县| 临江市| 萨迦县| 尚义县| 泰宁县| 德兴市| 遂川县| 漯河市| 惠来县| 漯河市| 舒城县| 荆门市| 张家口市| 丹巴县| 静乐县| 安岳县| 梅河口市| 连州市| 城市|