当前位置: 首页>>代码示例>>PHP>>正文


PHP handle_errors函数代码示例

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


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

示例1: getlicheck

function getlicheck() {
	$fileid = check_arg("fileid", "integer", $_REQUEST);
	handle_errors();
	
	$upload = core_getupload($fileid);
	
	if(array_key_exists("type", $_REQUEST)) {
		if($upload->type() != $_REQUEST["type"]) {
			exit;
		}
	}
	return $upload;
}
开发者ID:numist,项目名称:this-might-be-offensive,代码行数:13,代码来源:api.php

示例2: process_login_form

function process_login_form($smarty)
{
    global $Link;
    $errors = array();
    global $username;
    global $password;
    $Query = 'SELECT * FROM ' . USER . ' WHERE eMail = "' . $username . '" AND password = "' . md5($password) . '" AND accessLevel > 0';
    $Results = mysql_query($Query, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
    $num_rows = mysql_num_rows($Results);
    if ($num_rows == 1 && ($row = mysql_fetch_array($Results))) {
        // OK to Enter;
        // set userdata;
        $_SESSION['logged_in'] = true;
        $_SESSION['userid'] = $row['userID'];
        $_SESSION['playerid'] = $row['playerId'];
        $_SESSION['username'] = $row['eMail'];
        $_SESSION['firstname'] = $row['firstName'];
        $_SESSION['lastname'] = $row['lastName'];
        $_SESSION['email'] = $row['eMail'];
        $_SESSION['site_access'] = $row['accessLevel'];
        session_write_close();
        set_cookie($row);
        //TODO: Setup where the user goes once login is verified
        if (true) {
            // User
            header("Location: account.php");
        } else {
            // Disabled Account
            header("Location: logout.php");
        }
    } else {
        $errors[] = "Access Not Permitted:<br />Username / Password Error";
        handle_errors($errors);
        handle_reposts();
    }
}
开发者ID:klangrud,项目名称:tcshl,代码行数:36,代码来源:login.php

示例3: News

 * Load all available News
 */
require_once '../config/autoload.php';
require_once EMC_PARENT_DIR . 'layout/header.php';
/* Prepare and execute the request */
$lib = new News();
$module_version = '3.0.0';
$module_platform = 'prestashop';
$lib->loadNews($module_platform, $module_version);
echo "<h3>API News :</h3>";
if (!$lib->curl_error && !$lib->resp_error) {
    // If you want to recieve order's status changes or documents, check for "url_push" param in samples/make_order.php
    echo '<pre>' . print_r($lib->news, true) . '</pre>';
} else {
    echo '<div class="alert alert-danger">';
    handle_errors($lib);
    echo '</div>';
}
?>
<div class="well well-sm">
    <button type="button" class="btn btn-xs btn-default" id="toogleDebug">
        Toggle Debug
    </button>
    <pre id="debug" style="display: none">
        <?php 
print_r(array_merge($lib->getApiParam(), array('API response :' => $lib->news)));
?>
    </pre>
</div>
<?php 
require_once EMC_PARENT_DIR . 'layout/footer.php';
开发者ID:boxtale,项目名称:php-library,代码行数:31,代码来源:get_news.php

示例4: initialize_payment_dates

$PAYMENT_DATE_3 = '';
$PAYMENT_DATE_4 = '';
initialize_payment_dates($SEASON);
$smarty->assign('daysToFirstPayment', get_payment_date_difference(1));
$smarty->assign('daysToSecondPayment', get_payment_date_difference(2));
$smarty->assign('daysToThirdPayment', get_payment_date_difference(3));
$smarty->assign('daysToFourthPayment', get_payment_date_difference(4));
if (isset($_POST['action']) && $_POST['action'] == "Edit Payments") {
    // If form does not validate, we need to return with errors.
    if ($errors = validate_payments_form()) {
        handle_errors($errors);
        handle_reposts();
    } else {
        // If errors occur while trying to create user, we need to return with errors.
        if ($errors = process_payments_form()) {
            handle_errors($errors);
            handle_reposts();
        } else {
            header("Location: editpaymentplan4.php?id={$P4_ID}&success=yes");
        }
    }
} else {
    populateFieldsFromDatabase();
}
format_date_fields();
$smarty->assign('P4_AUDIT', $P4_AUDIT);
$smarty->assign('P4_NAME', $P4_NAME);
$smarty->assign('P4_ID', $P4_ID);
$smarty->assign('P4_PAY1_PROCESS', $P4_PAY1_PROCESS);
$smarty->assign('P4_PAY1_DATE_SELECT', $P4_PAY1_DATE_SELECT);
$smarty->assign('P4_PAY1_DATE', $P4_PAY1_DATE);
开发者ID:klangrud,项目名称:tcshl,代码行数:31,代码来源:editpaymentplan4.php

示例5: handle_data

function handle_data($data, $is_sock = False, $auth = False, $exec = False)
{
    global $buckets;
    global $alias_locks;
    global $dest_overrides;
    global $admin_accounts;
    global $admin_data;
    global $admin_is_sock;
    global $admin_aliases;
    global $exec_errors;
    global $exec_list;
    global $throttle_time;
    global $ignore_list;
    if ($auth == False) {
        echo "[33m" . date("Y-m-d H:i:s", microtime(True)) . " > [0m{$data}";
        handle_errors($data);
    } else {
        term_echo("*** auth = true");
    }
    $items = parse_data($data);
    if ($items !== False) {
        write_out_buffer_data($items);
        if ($items["destination"] == DEBUG_CHAN) {
            return;
        }
        if ($auth == False and $is_sock == True) {
            log_items($items);
        }
        if (in_array($items["nick"], $ignore_list) == True) {
            return;
        }
        if (isset($buckets[BUCKET_IGNORE_NEXT]) == True and $items["nick"] == get_bot_nick()) {
            unset($buckets[BUCKET_IGNORE_NEXT]);
            return;
        }
        if ($items["prefix"] == IRC_HOST and strpos(strtolower($items["trailing"]), "throttled") !== False) {
            term_echo("*** THROTTLED BY SERVER - REFUSING ALL OUTGOING MESSAGES TO SERVER FOR " . THROTTLE_LOCKOUT_TIME . " SECONDS ***");
            $throttle_time = microtime(True);
            return;
        }
        if ($items["cmd"] == 330) {
            authenticate($items);
        }
        if ($items["cmd"] == 376) {
            dojoin(INIT_CHAN_LIST);
        }
        if ($items["cmd"] == "NOTICE" and $items["nick"] == "NickServ" and $items["trailing"] == NICKSERV_IDENTIFY_PROMPT) {
            if (file_exists(PASSWORD_FILE) == True and NICKSERV_IDENTIFY === "1") {
                rawmsg("NickServ IDENTIFY " . trim(file_get_contents(PASSWORD_FILE)), True);
            }
            startup();
        }
        $args = explode(" ", $items["trailing"]);
        if (in_array($args[0], $admin_aliases) == True or has_account_list($args[0]) == True) {
            if ($auth == False and $is_sock == True) {
                term_echo("authenticating \"" . $args[0] . "\"...");
                $admin_data = $items["data"];
                $admin_is_sock = $is_sock;
                rawmsg("WHOIS " . $items["nick"]);
                return;
            }
        }
        $alias = $args[0];
        handle_events($items);
        switch ($alias) {
            case ALIAS_ADMIN_NICK:
                if (count($args) == 2) {
                    rawmsg(":" . get_bot_nick() . " NICK :" . trim($args[1]));
                    set_bot_nick(trim($args[1]));
                }
                break;
            case ALIAS_ADMIN_QUIT:
                if (count($args) == 1) {
                    write_out_buffer_command($items, "quit");
                    process_scripts($items, ALIAS_QUIT);
                }
                break;
            case ALIAS_ADMIN_PS:
                if (count($args) == 1) {
                    write_out_buffer_command($items, "ps");
                    ps($items);
                }
                break;
            case ALIAS_ADMIN_KILL:
                if (count($args) == 2) {
                    write_out_buffer_command($items, "kill");
                    kill($items, $args[1]);
                }
                break;
            case ALIAS_ADMIN_KILLALL:
                if (count($args) == 1) {
                    write_out_buffer_command($items, "killall");
                    killall($items);
                }
                break;
            case ALIAS_LIST:
                if (check_nick($items, $alias) == True) {
                    if (count($args) == 1) {
                        write_out_buffer_command($items, "list");
                        get_list($items);
//.........这里部分代码省略.........
开发者ID:cmn32480,项目名称:exec-irc-bot,代码行数:101,代码来源:irc_lib.php

示例6: Registration

if (isset($_GET['id']) && $_GET['id'] > 0) {
    $registration = new Registration($_GET['id']);
    $registration->formPreLoad($smarty);
    $smarty->assign('id', $registration->get_registrationID());
} else {
    if (isset($_POST['action']) && $_POST['action'] == "Edit Registration") {
        $registration = new Registration($_POST['id']);
        $smarty->assign('id', $registration->get_registrationID());
        // If form does not validate, we need to return with errors.
        if ($registration->formValidation()) {
            handle_errors($registration->get_formErrors());
            $registration->formReposts($smarty);
        } else {
            // If errors occur while trying to create user, we need to return with errors.
            if ($registration->formProcessUpdate()) {
                handle_errors($registration->get_formErrors());
                $registration->formReposts($smarty);
            } else {
                $registration->formPreLoad($smarty);
                handle_success($registration->get_formSuccess());
            }
        }
    } else {
        header("Location: manageregistrations.php");
    }
}
$smarty->assign('page_name', 'Edit ' . $registration->get_fName() . ' ' . $registration->get_lName() . '\'s Season Registration');
$smarty->assign('type', 'EDIT');
// Build the page
require 'global_begin.php';
$smarty->display('admin/editregistration.tpl');
开发者ID:klangrud,项目名称:tcshl,代码行数:31,代码来源:editregistration.php

示例7: handle_errors

                // If errors occur while trying to update team, we need to return with errors.
                if ($team->formProcessUpdate()) {
                    handle_errors($team->get_teamFormErrors());
                    $team->formReposts($smarty);
                } else {
                    handle_success($team->get_teamFormSuccess());
                }
            }
        }
    }
}
// if GET request to Delete team
if (isset($_GET['teamID']) && $_GET['teamID'] > 0 && $_GET['delete'] == 1) {
    $team = new Team($_GET['teamID']);
    if ($team->formProcessDelete()) {
        handle_errors($team->get_teamFormErrors());
        $team->formReposts($smarty);
    } else {
        handle_success($team->get_teamFormSuccess());
    }
}
// Build list of teams
$Teams = new Teams();
$TeamsArray = $Teams->get_TeamArray(0);
if (count($TeamsArray) > 0) {
    $count = 0;
    $smarty->assign('teamID', array());
    $smarty->assign('teamName', array());
    $smarty->assign('teamShortName', array());
    $smarty->assign('teamFGColor', array());
    $smarty->assign('teamBGColor', array());
开发者ID:klangrud,项目名称:tcshl,代码行数:31,代码来源:teammanager.php

示例8: api_resetsubscription

	/**
	 * @method resetsubscription
	 *
	 * Reset your subscription to a thread. New posts made to the thread after this call will cause the subscription to become active again.
	 *
	 * @param threadid integer required Reset the subscription to this thread.
	 * @return true if reset, false if no subscription or upload does not exist.
	 * @example threadid=309779
	 * @see subscribe
	 * @see unreadcomments
	 */
	function api_resetsubscription() {
		$threadid = check_arg("threadid", "integer");
		handle_errors();
		
		send(id(new Upload($threadid))->clearSubscription());
	}
开发者ID:numist,项目名称:this-might-be-offensive,代码行数:17,代码来源:api.php

示例9: handle_errors

                // If errors occur while trying to create board member, we need to return with errors.
                if ($boardMember->formProcessUpdate()) {
                    handle_errors($boardMember->get_boardMemberFormErrors());
                    $boardMember->formReposts($smarty);
                } else {
                    handle_success($boardMember->get_boardMemberFormSuccess());
                }
            }
        }
    }
}
// if GET request to Delete board member
if (isset($_GET['boardMemberID']) && $_GET['boardMemberID'] > 0 && $_GET['delete'] == 1) {
    $boardMember = new BoardMember($_GET['boardMemberID']);
    if ($boardMember->formProcessDelete()) {
        handle_errors($boardMember->get_boardMemberFormErrors());
        $boardMember->formReposts($smarty);
    } else {
        handle_success($boardMember->get_boardMemberFormSuccess());
    }
}
// Build list of board members
$BoardMembers = new BoardMembers();
$BoardMembersArray = $BoardMembers->get_BoardMemberArray(0);
if (count($BoardMembersArray) > 0) {
    $count = 0;
    $smarty->assign('boardMemberID', array());
    $smarty->assign('boardMemberName', array());
    $smarty->assign('boardMemberFirstName', array());
    $smarty->assign('boardMemberLastName', array());
    $smarty->assign('boardMemberEmail', array());
开发者ID:klangrud,项目名称:tcshl,代码行数:31,代码来源:boardmembermanager.php

示例10: process_registration_form

function process_registration_form($smarty)
{
    global $Link;
    $errors = array();
    $fname = format_uppercase_text($_POST['firstname']);
    $lname = format_uppercase_text($_POST['lastname']);
    $email = format_trim(strtolower($_POST['email']));
    $pass = md5($_POST['password']);
    $verificationKey = createVerificationKey($email);
    //Check if user exists with accessLevel > 0.  If true, then we will just error out registration and explain that user exists.
    $query = 'SELECT email, accessLevel FROM ' . USER . ' WHERE email = "' . $email . '" AND accessLevel > 0';
    $result = mysql_query($query, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
    if ($result && mysql_num_rows($result) > 0) {
        $errors[] = 'User already exists.  If you forgot your password, <a href="resetpassword.php">click here</a> to have it reset.';
        handle_errors($errors);
        handle_reposts();
    }
    if (count($errors) == 0) {
        //Check if user exists with accessLevel 0.  If true, then we will just resend validation email
        $query = 'SELECT email, accessLevel, verificationKey FROM ' . USER . ' WHERE email = "' . $email . '" AND accessLevel = 0';
        $result = mysql_query($query, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
        if ($result && mysql_num_rows($result) > 0 && ($row = mysql_fetch_array($result))) {
            $verificationKey = $row['verificationKey'];
            send_validation_email($email, $verificationKey);
            header("Location: pending.php");
        } else {
            // Insert new user query
            $query = "INSERT INTO " . USER . " (firstname, lastname, email, password, verificationKey) ";
            $query .= "VALUES ('{$fname}', '{$lname}', '{$email}', '{$pass}', '{$verificationKey}')";
            $result = mysql_query($query, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
            if ($result) {
                send_validation_email($email, $verificationKey);
                send_admin_email();
            } else {
                $errors[] = "No user was created.";
            }
        }
        // End of else
    }
    // if (!errors)
    return $errors;
}
开发者ID:klangrud,项目名称:tcshl,代码行数:42,代码来源:siteregistration.php


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