• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP error_handler函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中error_handler函数的典型用法代码示例。如果您正苦于以下问题:PHP error_handler函数的具体用法?PHP error_handler怎么用?PHP error_handler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了error_handler函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: login_theme

function login_theme()
{
    global $globals, $mysql, $done, $error, $errors;
    global $l;
    error_handler($error);
    if ($done) {
        //echo $l['thanks'] . '<a href="index.php?action=login">Login</a> here';
        echo $l['redirection'];
    } else {
        echo '<center>';
        echo $l['test_login_msg'];
        // for input fields, pattern attribute,
        // pattern="^\(?\d{3}\)?[-\s]\d{3}[-\s]\d{4}.*?$"  , pattern to check, fone pattern format, such as, (555)-555-5555
        echo '
			<form action="" method="post">
				<table align="center">
					<tr>
						<td width="70%">' . $l['user_email'] . '</td>
						<td><input type="text" name="email" placeholder="For eg. [email protected]" required> </td>
					</tr>
					<tr>
						<td>' . $l['pass'] . '</td>
						<td><input type="password" name="password" required></td>
					</tr>
				</table>
				<br />
				<center><input type="submit" name="sub_register" value="Login"></center>
			</form>
			</center>
		';
    }
}
开发者ID:ashish2,项目名称:resumer,代码行数:32,代码来源:login_theme.php


示例2: compare

 public function compare(PageResolver $r1, PageResolver $r2)
 {
     $contents1 = PageUtils::contents($r1);
     $contents2 = PageUtils::contents($r2);
     if ($contents2 === null) {
         $fetch = app(Fetch::class);
         //todo: move this to Fetch constructor & make it configurable
         if (method_exists($fetch, 'cached')) {
             $fetch = $fetch->cached(false);
         }
         $contents2 = $fetch->pull($r2->page->absoluteLink());
         if (!$fetch->isOk()) {
             if ($fetch->code() == 404) {
                 $r2->page->delete();
                 return new EqualCompare($contents1, $this->size($contents1));
             } else {
                 throw new CompareFetchError($r2->page, $fetch->code());
             }
         }
         $size = $this->size($contents2);
         $contents2 = $this->cleanup($contents2);
         if (!PageUtils::putContents($r2, $contents2, $this->fetchedEncoding)) {
             error_handler(E_USER_ERROR, "Failed to save \"{$r2}\"", basename(__FILE__), 28);
             return false;
         }
         $contents2 = PageUtils::contents($r2);
     } else {
         $size = null;
     }
     return new Compare($contents1, $contents2, $size);
 }
开发者ID:ankhzet,项目名称:Ankh,代码行数:31,代码来源:Comparator.php


示例3: listUsers_theme

function listUsers_theme()
{
    global $globals, $mysql, $theme, $done, $errors;
    global $user;
    global $q, $l;
    error_handler($errors);
    echo '<center>
	<h3>' . $l['list_users'] . '</h3>
	<table border="1">
		<tr id="disp_table">
			<td><b>' . $l['listing'] . '</td>
			<td><b>' . $l['uid'] . '</b></td>
			<td><b>' . $l['username'] . '</b></td>
			<td><b>' . $l['email'] . '</b></td>
			<td><b>' . $l['url'] . '</b></td>
			<td><b>' . $l['friend_uid'] . '</b></td>
		</tr>';
    $i = 1;
    while ($row = mysql_fetch_assoc($q)) {
        echo "\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{$i}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$row['uid']}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<a href={$globals['boardurl']}{$globals['only_ind']}action=viewProfile&uid={$row['uid']}>{$row['username']}</a>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$row['email']}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$row['url']}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$row['friends_list']}\n\t\t\t</td>\n\t\t</tr>\n\t\t";
        $i++;
    }
    // setting $row as null, clearing/cleaning/emptying php memory
    $row = null;
    echo '</table>';
    /*
    echo '</table><br /><br />
    <a href="index.php?action=wall&uid='.$user['uid']. '">Wall</a> | 
    <a href="index.php?action=modifyprofile&uid='.$user['uid']. '">Modify Profile</a> | 
    <a href="index.php?action=ban&uid='.$user['uid']. '">Ban him!!!</a>
    </center>';
    */
}
开发者ID:ashish2,项目名称:resumer,代码行数:33,代码来源:list_theme.php


示例4: register_theme

function register_theme()
{
    global $globals, $mysql, $done, $error;
    global $l;
    error_handler($error);
    // if exists, then 'email exists' error, etc. (still to put)
    if ($done) {
        echo $l['thanks'] . '<a href="index.php?action=login">' . $l['login'] . '</a> here';
    } else {
        echo '
			<form action="" method="post">
				<table align="center">
					<tr>
						<td width="70%">' . $l['usrnm'] . '</td>
						<td><input type="text" name="username" required> </td>
					</tr>
					<tr>
						<td>' . $l['pass'] . '</td>
						<td><input type="text" name="password" required></td>
					</tr>
					<tr>
						<td>' . $l['email'] . '</td>
						<td><input type="text" name="email" required> </td>
					</tr>
					<tr>
						<td>' . $l['web_url'] . '</td>
						<td><input type="text" name="url"> </td>
					</tr>
				</table>
				<center><input type="submit" name="sub_register" value="Register"></center>
			</form>
		';
    }
}
开发者ID:ashish2,项目名称:resumer,代码行数:34,代码来源:register_theme.php


示例5: shutdown

function shutdown()
{
    $error = error_get_last();
    if ($error['type'] === E_ERROR) {
        error_handler('', '', '', '');
    }
}
开发者ID:a-i-ko93,项目名称:ipl-foodblog,代码行数:7,代码来源:posts.php


示例6: cobalt_password_hash_bcrypt

function cobalt_password_hash_bcrypt($password, $salt, $iteration)
{
    //Deal with blowfish bug in PHP < 5.3.7
    if (PHP_VERSION_ID < 50307) {
        error_handler("Cobalt encountered an error during password processing.", "Cobalt Password Hash Error: Attempted to use bcrypt on onlder than PHP 5.3.7. This is a known security risk, and has been stopped. Please change preferred hashing method to an alternative. (SHA512 recommended)");
    } else {
        $blowfish_salt_start = '$2y$';
    }
    //make sure cost factor is two digit only and within the range 04-31, else crypt() will fail
    if ($iteration > 31) {
        $iteration = 31;
    }
    if ($iteration < 10) {
        $iteration = '0' . $iteration;
    }
    if ($iteration < 4) {
        $iteration = '04';
    }
    $blowfish_cost = $iteration;
    $blowfish_key = '$' . $salt . '$';
    $blowfish_key = str_replace('+', '.', $blowfish_key);
    //blowfish salt doesn't support + char
    $blowfish_salt = $blowfish_salt_start . $blowfish_cost . $blowfish_key;
    $digest = crypt($password . $salt, $blowfish_salt);
    return $digest;
}
开发者ID:seans888,项目名称:APC-CPO,代码行数:26,代码来源:password_crypto.php


示例7: sendMessage_theme

function sendMessage_theme()
{
    global $globals, $mysql, $theme, $done, $error, $errors;
    global $user;
    global $par;
    global $db;
    global $l;
    error_handler($error);
    echo '
		<form method="post" action="" name="form1">
			<table align="center" width="90%" border="0">
				<tr>
					<td width="30%">' . $l['to'] . '</td>
					<td><input type="text" name="to"> </td>
				</tr>' . '<tr>
					<td>' . $l['subj'] . '</td>
					<td><input type="text" name="subject"> </td>
				</tr>
				<tr>
					<td>' . $l['body'] . '</td>
					<td><textarea rows="15" cols="60" name="body"></textarea> </td>
				</tr>
			</table>
			<br />
			<br />
			<center>
				<input type="submit" id="sendMess" name="sendMess" value="Send Message">
			</center>
		</form>
	';
}
开发者ID:ashish2,项目名称:resumer,代码行数:31,代码来源:messages_theme.php


示例8: fatalErrorShutdownHandler

function fatalErrorShutdownHandler()
{
    $last_error = error_get_last();
    if ($last_error['type'] === E_ERROR || $last_error['type'] === E_PARSE) {
        error_handler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']);
    }
}
开发者ID:hcvcastro,项目名称:pxp,代码行数:7,代码来源:Errores.php


示例9: index

 public function index($image_name)
 {
     $file_path = APP_ROOT . "/img/" . "{$image_name}";
     $file_info = pathinfo($file_path);
     switch ($file_info["extension"]) {
         case 'bmp':
             header('Content-Type: image/bmp');
             break;
         case 'gif':
             header('Content-Type: image/gif');
             break;
         case 'jpg':
             header('Content-Type: image/jpeg');
             break;
         case 'jpeg':
             header('Content-Type: image/jpeg');
             break;
         case 'png':
             header('Content-Type: image/png');
             break;
         default:
             error_handler("Create_thumb: Unsupported picture type: " . $src . "--" . $type);
             return;
     }
     $fp = fopen($file_path, 'r');
     fpassthru($fp);
 }
开发者ID:swatisaoji1,项目名称:tableforyou,代码行数:27,代码来源:staticImage.php


示例10: shutdown_error_handler

function shutdown_error_handler()
{
    $error = error_get_last();
    if (empty($error) === false) {
        error_handler($error['type'], $error['message'], $error['file'], $error['line']);
    }
}
开发者ID:goXXip,项目名称:mihalismmh,代码行数:7,代码来源:catcherror.php


示例11: login

function login()
{
    global $error;
    if (isset($_GET['error'])) {
        error_handler($_GET['error']);
    }
    if (!isset($_POST['username']) or !isset($_POST['password'])) {
        return false;
    }
    $username = $_POST['username'];
    $password = $_POST['password'];
    if (empty($username) and empty($password)) {
        $error = 'You did not fill out all forms. Do so please.';
        return false;
    }
    if (!filter_var($username, FILTER_VALIDATE_EMAIL)) {
        $error = 'This is not an email, please fill in an email-address.';
        return false;
    }
    $user = query('SELECT id FROM users WHERE email = "' . $username . '" AND password = "' . $password . '" ');
    if ($_POST["vercode"] != $_SESSION["vercode"] or $_SESSION["vercode"] == '') {
        echo '<strong>Wrong verification code.</strong>';
    } else {
        if (count($user) < 1) {
            $error = 'Wrong email, password or verification code.';
            return false;
        }
    }
    $_SESSION['id'] = $user[0]['id'];
    header('Location: ../views/resultpage.php');
    exit;
}
开发者ID:Erlau,项目名称:JSON-writer-with-login,代码行数:32,代码来源:login.php


示例12: ErrorHandler

 function ErrorHandler($errno, $errstr, $errfile, $errline)
 {
     if ($errno == E_USER_NOTICE) {
         $this->errors[] = $errstr;
     } else {
         error_handler($errno, $errstr, $errfile, $errline);
     }
 }
开发者ID:hackingman,项目名称:TradeX,代码行数:8,代码来源:compiler.php


示例13: ban_theme

function ban_theme()
{
    global $globals, $mysql, $theme, $done, $error, $errors, $l;
    // Get all data of the user, whether to allow
    // him to view or enter the board.
    // user level, user permissions
    global $user, $notice;
    global $board, $replies;
    global $qu;
    // boards will be listed here, get data from DB
    // Board table, having, board_id, board_name, board_desc,
    // user_id who started board(admin or moderator),
    // number of replies in Reply table
    // who replied etc, replies to a board_id in reply table
    // name of board, which username started board,
    // how many posts in board
    error_handler($error);
    if (!empty($notice)) {
        notice_handler($notice);
        return;
    }
    if ($qu) {
        echo '
			<center>
			<table border="1" >
				<tr id="disp_table">
					<td>
						' . $l['ban_uid'] . '
					</td>
					<td>
						' . $l['ban_uname'] . '
					</td>
				</tr>
			';
        for (; $i = mysql_fetch_assoc($qu);) {
            echo '
				<tr>
					<td>
						' . $i['ban_uid'] . '
					</td>
					<td>
						' . $i['username'] . '
					</td>
				</tr>';
        }
        echo '
			</table>
			</center>
		';
    } else {
        noData();
    }
}
开发者ID:ashish2,项目名称:resumer,代码行数:53,代码来源:bannedList_theme.php


示例14: fatal_error_handler

/**
 * Функция перехвата фатальных ошибок
 */
function fatal_error_handler()
{
    // если была ошибка и она фатальна
    if ($error = error_get_last() and $error['type'] & (E_ERROR | E_PARSE | E_COMPILE_ERROR | E_CORE_ERROR)) {
        // очищаем буффер (не выводим стандартное сообщение об ошибке)
        ob_end_clean();
        // запускаем обработчик ошибок
        error_handler($error['type'], $error['message'], $error['file'], $error['line']);
    } else {
        // отправка (вывод) буфера и его отключение
        ob_end_flush();
    }
}
开发者ID:scuba323,项目名称:dcoin,代码行数:16,代码来源:errors.php


示例15: check_for_fatal_error

function check_for_fatal_error()
{
    $error = error_get_last();
    $isError = false;
    switch ($error['type']) {
        case E_ERROR:
        case E_CORE_ERROR:
        case E_PARSE:
        case E_COMPILE_ERROR:
        case E_USER_ERROR:
            error_handler($error["type"], $error["message"], $error["file"], $error["line"]);
    }
}
开发者ID:p2004a,项目名称:CTF,代码行数:13,代码来源:quiz.php


示例16: adminMain_theme

function adminMain_theme()
{
    global $globals, $mysql, $theme, $done, $errors;
    global $user;
    global $q, $l;
    if ($errors) {
        error_handler($errors);
        return false;
    }
    echo 'Welcome to the Admin Section...! Still Work in Progress...';
    echbr(2);
    echo '<a href="index.php?action=listUsers">' . $l['l_users'] . '</a>';
}
开发者ID:ashish2,项目名称:resumer,代码行数:13,代码来源:admin_theme.php


示例17: fatalErrorShutdownHandler

function fatalErrorShutdownHandler()
{
    $last_error = error_get_last();
    if ($last_error['type'] === E_ERROR || $last_error['type'] === E_PARSE) {
        global $_handled_errors;
        // fatal error
        error_handler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']);
        if (!empty($_handled_errors)) {
            @ob_clean();
            echo json_encode($_handled_errors);
            logErrors(new \ErrorException($last_error['message'], 0, 1, $last_error['file'], $last_error['line']), 500);
        }
        header("HTTP/1.0 500 Service not available");
    }
}
开发者ID:sauliusmiklas,项目名称:survey,代码行数:15,代码来源:FatalErrorHandler.php


示例18: run

 public function run($task_id)
 {
     $this->task = $this->panther_tasks[$task_id];
     if (!preg_match('/^[a-z-_0-9]+$/i', $this->task['script']) || !file_exists(PANTHER_ROOT . 'include/tasks/' . $this->task['script'] . '.php')) {
         error_handler(E_ERROR, 'Invalid task name or task does not exist', __FILE__, __LINE__);
     }
     if ($this->task['locked']) {
         return;
     }
     // Lock the task so it can't be ran twice
     $this->lock();
     $task_name = 'task_' . $this->task['script'];
     if (!class_exists($task_name)) {
         require PANTHER_ROOT . 'include/tasks/' . $this->task['script'] . '.php';
         $task = new $task_name($this->db, $this->panther_config, $this->updater);
     }
     $this->lock(0);
 }
开发者ID:mtechnik,项目名称:pantherforum,代码行数:18,代码来源:tasks.php


示例19: friendsList_theme

function friendsList_theme()
{
    global $globals, $mysql, $done, $error, $errors, $notice;
    global $l, $notice, $qu;
    global $show;
    error_handler($error);
    notice_handler($notice);
    $str = '';
    if ($show) {
        if (mysql_num_rows($qu) > 0) {
            $str .= '<center><div><b>' . $l['frnds'] . '</b> <br />';
            while ($row = mysql_fetch_assoc($qu)) {
                $str .= "<p>" . null . "<span>\n\t\t\t\t\t\t{$row['username']} | \n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{$row['email']} | \n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{$row['url']} \n\t\t\t\t\t</span>\n\t\t\t\t</p>";
            }
            $str .= '</div></center>';
        }
    }
    echo $str;
}
开发者ID:ashish2,项目名称:resumer,代码行数:19,代码来源:friends_theme.php


示例20: addReply_theme

function addReply_theme()
{
    global $globals, $mysql, $theme, $done, $errors, $error, $notice;
    // Get all data of the user, whether to allow
    // him to view or enter the board.
    // user level, user permissions
    global $user, $l;
    global $board, $replies, $row;
    // boards will be listed here, get data from DB
    // Board table, having, board_id, board_name, board_desc,
    // user_id who started board(admin or moderator),
    // number of replies in Reply table
    // who replied etc, replies to a board_id in reply table
    // name of board, which username started board,
    // how many posts in board
    error_handler($error);
    notice_handler($notice);
    $subject = '';
    // if not isset $_GET[post], that means it is not a createTopic, it only an addReply
    // if isset $_GET[post], that means it is a createTopic event
    if (!isset($_GET['post'])) {
        $subject = '<tr>
					<td valign="center">' . $l['subj'] . '</td>
					<td><input type="text" name="subject" value="Re: ' . $row['tname'] . '"></td>
			</tr>';
    }
    echo '
		<form method="post" action="">
			<table align="center">
			' . $subject . '
					<tr>
						<td valign="top">' . $l['reply'] . '</td>
						<td><textarea name="reply" rows="6" cols="35"></textarea></td>
					</tr>
				</table>
			<center><input class="mun-button-default" type="submit" name="reply_sub" value="Reply"></center>
		</form>
	';
}
开发者ID:ashish2,项目名称:resumer,代码行数:39,代码来源:addReply_theme.php



注:本文中的error_handler函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP error_layout函数代码示例发布时间:2022-05-15
下一篇:
PHP error_handled函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap