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


PHP error_page函数代码示例

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


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

示例1: error_page_404

function error_page_404($location = null)
{
    if (!$location && isset($_SERVER['REQUEST_URI'])) {
        $location = $_SERVER['REQUEST_URI'];
    }
    error_page('HTTP/1.0 404 Not Found', '404 Not Found', $location ? 'File "' . $location . '" not found.' : null);
}
开发者ID:mariomulansky,项目名称:website,代码行数:7,代码来源:boost_error_page.php

示例2: show_stats

function show_stats($brand)
{
    switch ($brand) {
        case 1:
            $x = "HTC Power to Give";
            break;
        default:
            error_page("invalid brand");
    }
    $hosts = BoincHost::enum("os_name='Android' and serialnum like '%{$x}%'");
    $n = 0;
    $t = 0;
    $a = 0;
    foreach ($hosts as $h) {
        $t += $h->total_credit;
        $a += $h->expavg_credit;
        if ($h->expavg_credit > 0.1) {
            $n++;
        }
    }
    page_head("Stats for {$x}");
    start_table();
    row2("Active devices", $n);
    row2("Average daily credit", $a);
    row2("Total credit", $t);
    end_table();
    page_tail();
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:28,代码来源:brand_stats.php

示例3: compare_aux

function compare_aux($select_name, $xset_name, $snap)
{
    global $top_unit, $course_id, $filter, $filter_cat;
    global $breakdown, $breakdown_cat;
    get_filters_from_form();
    $select_unit = lookup_unit($top_unit, $select_name);
    if (!$select_unit) {
        error_page("no select unit");
    }
    admin_page_head("Unit comparison");
    echo "\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . URL_BASE . "bolt_admin.css\">\n\t\tThe following compares the alternatives of\n\t\t<b>{$select_name}</b> with respect to <b>{$xset_name}</b>.\n\t\t<p>\n\t";
    echo "<table class=\"bolt_box\">";
    if ($breakdown) {
        echo "<tr class=bolt_head1><td colspan=2>Total</td></tr>";
    }
    compare_case(null, $select_unit, $snap, $filter, $filter_cat, null, null);
    if ($breakdown) {
        echo "<tr class=bolt_head1><td colspan=2>Breakdown by " . $breakdown->name() . "</td></tr>";
        foreach ($breakdown->categories() as $c) {
            compare_case($c, $select_unit, $snap, $filter, $filter_cat, $breakdown, $c);
            echo "<p>";
        }
    }
    echo "</table>";
    echo "\n\t\t<form action=bolt_compare.php>\n\t\t<input type=hidden name=action value=compare>\n\t\t<input type=hidden name=course_id value={$course_id}>\n\t\t<input type=hidden name=select_name value=\"{$select_name}\">\n\t\t<input type=hidden name=xset_name value=\"{$xset_name}\">\n\t\t<table width=600><tr><td>\n\t";
    filter_form($filter ? $filter->name() : "", $filter_cat);
    echo "</td><td>";
    breakdown_form($breakdown ? $breakdown->name() : "");
    echo "\n\t\t</td></tr></table>\n\t\t<p>\n\t\t<input type=submit value=OK>\n\t\t</form>\n\t";
    admin_page_tail();
}
开发者ID:Turante,项目名称:boincweb,代码行数:31,代码来源:bolt_compare.php

示例4: search_action

function search_action()
{
    $where = "true";
    $search_string = get_str('search_string');
    if (strlen($search_string)) {
        if (strlen($search_string) < 3) {
            error_page(tra("search string must be at least 3 characters"));
        }
        $s = BoincDb::escape_string($search_string);
        $s = escape_pattern($s);
        $where .= " and name like '{$s}%'";
    }
    $country = get_str('country');
    if ($country != 'any') {
        $s = BoincDb::escape_string($country);
        $where .= " and country='{$s}'";
    }
    $t = get_str('team');
    if ($t == 'yes') {
        $where .= " and teamid<>0";
    } else {
        if ($t == 'no') {
            $where .= " and teamid=0";
        }
    }
    $t = get_str('profile');
    if ($t == 'yes') {
        $where .= " and has_profile<>0";
    } else {
        if ($t == 'no') {
            $where .= " and has_profile=0";
        }
    }
    $search_type = get_str('search_type', true);
    $order_clause = "id desc";
    if ($search_type == 'rac') {
        $order_clause = "expavg_credit desc";
    } else {
        if ($search_type == 'total') {
            $order_clause = "total_credit desc";
        }
    }
    $fields = "id, create_time, name, country, total_credit, expavg_credit, teamid, url, has_profile, donated";
    $users = BoincUser::enum_fields($fields, $where, "order by {$order_clause} limit 100");
    page_head(tra("User search results"));
    $n = 0;
    foreach ($users as $user) {
        if ($n == 0) {
            start_table();
            table_header(tra("Name"), tra("Team"), tra("Average credit"), tra("Total credit"), tra("Country"), tra("Joined"));
        }
        show_user($user);
        $n++;
    }
    end_table();
    if (!$n) {
        echo tra("No users match your search criteria.");
    }
    page_tail();
}
开发者ID:maexlich,项目名称:boinc-igemathome,代码行数:60,代码来源:user_search.php

示例5: upload_guardian

function upload_guardian()
{
    $path = 'images/unknown.png';
    $file = $_FILES['picture'];
    if (empty($file['tmp_name'])) {
        return $path;
    }
    if ($file['size'] > 512000) {
        error_page('You are too big. >/////<');
    }
    if (!getimagesize($file['tmp_name'])) {
        error_page('not an image file.  >.^');
    }
    if (($pos = strrpos($file['name'], '.')) && in_array(strtolower(substr($file['name'], $pos)), array('.jpg', '.jpeg', '.png'))) {
    } else {
        error_page('the image is not allowed');
    }
    $upload_path = '../stub/' . md5(uniqid(mt_rand(), true));
    if (move_uploaded_file($file['tmp_name'], $upload_path)) {
        $path = $upload_path;
    } else {
        error_page('unknown error.');
    }
    return $path;
}
开发者ID:Adios,项目名称:Wanted,代码行数:25,代码来源:make.php

示例6: compare_gen

function compare_gen($select_name, $xset_name, $n, $a1, $d1, $x, $a2, $d2)
{
    global $course;
    $top_unit = (require_once $course->doc_file());
    $select_unit = lookup_unit($top_unit, $select_name);
    if (!$select_unit) {
        error_page("no such select unit");
    }
    if (!lookup_unit($top_unit, $xset_name)) {
        error_page("no such xset");
    }
    $m = count($select_unit->units);
    for ($i = 0; $i < $n; $i++) {
        $uid = random_student();
        $t1 = time();
        $t2 = $t1 + 1;
        $j = rand(0, $m - 1);
        $child = $select_unit->units[$j];
        BoltSelectFinished::insert("(user_id, course_id, end_time, name, selected_unit) values ({$uid}, {$course->id}, {$t1}, '{$select_name}', '{$child->name}')");
        if ($child->name == $x) {
            $score = urand($a2, $d2);
        } else {
            $score = urand($a1, $d1);
        }
        BoltXsetResult::insert("(create_time, user_id, course_id, start_time, end_time, name, score) values ({$t2}, {$uid}, {$course->id}, {$t2}, {$t2}, '{$xset_name}', {$score})");
    }
}
开发者ID:Turante,项目名称:boincweb,代码行数:27,代码来源:bolt_datagen.php

示例7: form_validate

function form_validate()
{
    global $mybb;
    $t = form_token();
    if ($t != $_POST['_t']) {
        error_page('Sorry, the form you submitted was invalid. Please try again.');
    }
}
开发者ID:darwinkim,项目名称:onlinesequencer,代码行数:8,代码来源:functions.form.php

示例8: auth_page

function auth_page()
{
    if (!session_is_vaild()) {
        // failed!
        error_page("Session non-exist or expired, please login again and make sure to turn on the cookie support.");
        exit;
    }
    return 0;
}
开发者ID:ryys1122,项目名称:torqace,代码行数:9,代码来源:auth.php

示例9: delete_profile

function delete_profile($user)
{
    $result = BoincProfile::delete_aux("userid = {$user->id}");
    if (!$result) {
        error_page("couldn't delete profile - please try again later");
    }
    delete_user_pictures($user->id);
    page_head("Delete Confirmation");
    $user->update("has_profile=0");
    echo "Your profile has been deleted<br />";
    page_tail();
}
开发者ID:Turante,项目名称:boincweb,代码行数:12,代码来源:delete_profile.php

示例10: sendHTMLPage

function sendHTMLPage()
{
    $menu = MainMenu::getInstance();
    $page = Page::getInstance();
    if ($page->getError()) {
        header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
        error_page();
        exit;
    }
    header("Content-Type: text/html; charset=utf-8");
    if (sendHeaders()) {
        echo HTML();
    }
}
开发者ID:oliver-eifler,项目名称:olli.php,代码行数:14,代码来源:template.php

示例11: add_app

function add_app()
{
    $name = BoincDb::escape_string(post_str('add_name'));
    $user_friendly_name = BoincDb::escape_string(post_str('add_user_friendly_name'));
    if (empty($name) || empty($user_friendly_name)) {
        error_page("To add a new application please supply both a brief name and a longer 'user-friendly' name.</font></p>");
    }
    $now = time();
    $id = BoincApp::insert("(name,user_friendly_name,create_time) VALUES ('{$name}', '{$user_friendly_name}', {$now})");
    if (!$id) {
        error_page("insert failed");
    }
    echo "Application added.\n        <p>\n        You must restart the project for this to take effect.\n    ";
}
开发者ID:maexlich,项目名称:boinc-igemathome,代码行数:14,代码来源:manage_apps.php

示例12: exception_error

function exception_error($e)
{
    $s = '<dl>';
    //  $s .= get_dtdd("Message",$e->getMessage());
    //  $s .= get_dtdd("Previous",$e->getPrevious());
    $s .= get_dtdd("Code", $e->getCode());
    //  $s .= get_dtdd("File",$e->getFile());
    //  $s .= get_dtdd("Line",$e->getLine());
    //  $s .= get_dtdd("Trace",$e->getTrace());
    //  $s .= get_dtdd("TraceAsString",$e->getTraceAsString());
    //  $s .= get_dtdd("ToString",$e->__toString());
    $s .= "</dl>";
    error_page($s);
}
开发者ID:amoschou,项目名称:acet,代码行数:14,代码来源:pagefunctions.php

示例13: delete_storylink

function delete_storylink($linkid)
{
    if (!is_numeric($linkid)) {
        return;
    }
    $query = "SELECT * FROM " . table_links . " WHERE link_id = '{$linkid}'";
    if (!($result = mysql_query($query))) {
        error_page(mysql_error());
    } else {
        $sql_array = mysql_fetch_object($result);
    }
    # delete the story link
    $query = "DELETE FROM " . table_links . " WHERE link_id = '{$linkid}'";
    if (!($result = mysql_query($query))) {
        error_page(mysql_error());
    }
    # delete the story comments
    $query = "DELETE FROM " . table_comments . " WHERE comment_link_id = '{$linkid}'";
    if (!($result = mysql_query($query))) {
        error_page(mysql_error());
    }
    # delete the saved links
    $query = "DELETE FROM " . table_saved_links . " WHERE saved_link_id = '{$linkid}'";
    if (!($result = mysql_query($query))) {
        error_page(mysql_error());
    }
    # delete the story tags
    $query = "DELETE FROM " . table_tags . " WHERE tag_link_id = '{$linkid}'";
    if (!($result = mysql_query($query))) {
        error_page(mysql_error());
    }
    # delete the story trackbacks
    $query = "DELETE FROM " . table_trackbacks . " WHERE trackback_link_id = '{$linkid}'";
    if (!($result = mysql_query($query))) {
        error_page(mysql_error());
    }
    # delete the story votes
    $query = "DELETE FROM " . table_votes . " WHERE vote_link_id = '{$linkid}'";
    if (!($result = mysql_query($query))) {
        error_page(mysql_error());
    }
    # delete additional categories
    $query = "DELETE FROM " . table_additional_categories . " WHERE ac_link_id = '{$linkid}'";
    if (!($result = mysql_query($query))) {
        error_page(mysql_error());
    }
    // module system hook
    $vars = array('link_id' => $linkid);
    check_actions('admin_story_delete', $vars);
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:50,代码来源:admin_delete_stories.php

示例14: db_query

function db_query($query)
{
    global $link, $queries;
    $time0 = microtime(true);
    $result = mysqli_query($link, $query);
    $time1 = microtime(true);
    $elapsed = $time1 - $time0;
    if (TEST) {
        $queries .= $query . ' ' . $elapsed . "\n";
    }
    if (!$result) {
        error_page("Database error: " . mysqli_error($link) . (TEST ? '<br/>Query: ' . $query : ''));
    } else {
        return $result;
    }
}
开发者ID:darwinkim,项目名称:onlinesequencer,代码行数:16,代码来源:functions.database.php

示例15: update

function update()
{
    $id = post_int("id");
    $av = BoincAppVersion::lookup_id($id);
    if (!$av) {
        error_page("no such app version");
    }
    $n = post_str("beta", true) ? 1 : 0;
    $av->update("beta={$n}");
    $n = post_str("deprecated", true) ? 1 : 0;
    $av->update("deprecated={$n}");
    $n = post_int("min_core_version");
    $av->update("min_core_version={$n}");
    $n = post_int("max_core_version");
    $av->update("max_core_version={$n}");
    echo "<b>Updated app version {$id}.  This change will take effect when you restart the project.</b><p>";
}
开发者ID:entibasse,项目名称:superhost,代码行数:17,代码来源:manage_app_versions.php


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