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

PHP error_out函数代码示例

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

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



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

示例1: view

 function view()
 {
     $user_id = $this->params[0];
     if (empty($user_id)) {
         error_out('Check user ID in address bar');
     }
     $this->user = get_first("SELECT * FROM user WHERE user_id = '{$user_id}'");
 }
开发者ID:PindsterY,项目名称:Meliss,代码行数:8,代码来源:users.php


示例2: exec_query

function exec_query($sql)
{
    static $conn = null;
    if ($conn == null) {
        $conn = get_db_connection();
    }
    if (mysql_query($sql, $conn) === FALSE) {
        error_out(500, "MySQL Error: " . mysql_error($conn) . "; running query: {$sql}");
    }
}
开发者ID:nysenate,项目名称:SendgridStatsAccumulator,代码行数:10,代码来源:fix_event_ids.php


示例3: checkPostRedirect

function checkPostRedirect($client)
{
    global $passed;
    line_out("Checking to see if there was a POST redirect to a GET");
    $method = $client->getRequest()->getMethod();
    if ($method == "get") {
        $passed++;
    } else {
        error_out('Expecting POST to Redirect to GET - found ' . $method);
    }
}
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:11,代码来源:misc.php


示例4: main

function main($server_cfg)
{
    $game = "";
    if (isset($_GET["game"])) {
        $game = $_GET["game"];
        $candidate_path = sprintf($server_cfg["xhprof_ip_list"], $game);
        error_log($candidate_path . "\n");
        if (file_exists($candidate_path)) {
            header($_SERVER["SERVER_PROTOCOL"] . " 200 Ok");
            header("Content-type: text/plain");
            echo file_get_contents($candidate_path);
            return;
        } else {
            error_out("{$game} maybe invalid, path {$candidate_path} does not exist.");
        }
    } else {
        error_out("No game name passed");
    }
}
开发者ID:shourya07,项目名称:zperfmon,代码行数:19,代码来源:get_candidates.php


示例5: connect_db

function connect_db()
{
    global $con;
    @($con = new mysqli(DATABASE_HOSTNAME, DATABASE_USERNAME, DATABASE_PASSWORD));
    if ($connection_error = mysqli_connect_error()) {
        $errors[] = 'There was an error trying to connect to database at ' . DATABASE_HOSTNAME . ':<br><b>' . $connection_error . '</b>';
        require 'templates/error_template.php';
        die;
    }
    mysqli_select_db($con, DATABASE_DATABASE) or error_out('<b>Error:</b><i> ' . mysqli_error($con) . '</i><br>
		This usually means that MySQL does not have a database called <b>' . DATABASE_DATABASE . '</b>.<br><br>
		Create that database and import some structure into it from <b>doc/database.sql</b> file:<br>
		<ol>
		<li>Open database.sql</li>
		<li>Copy all the SQL code</li>
		<li>Go to phpMyAdmin</li>
		<li>Create a database called <b>' . DATABASE_DATABASE . '</b></li>
		<li>Open it and go to <b>SQL</b> tab</li>
		<li>Paste the copied SQL code</li>
		<li>Hit <b>Go</b></li>
		</ol>');
    mysqli_query($con, "SET NAMES utf8");
    mysqli_query($con, "SET CHARACTER utf8");
}
开发者ID:vtanel,项目名称:Raamatukogu,代码行数:24,代码来源:database.php


示例6: error_out

    } else {
        error_out("Not found");
    }
    // Good guess
    $u = $url . "?guess=42";
    line_out("Retrieving " . htmlent_utf8($u));
    $crawler = $client->request('GET', $u);
    $html = $crawler->html();
    $OUTPUT->togglePre("Show retrieved page", $html);
    line_out("Looking for 'Congratulations - You are right'");
    if (stripos($html, 'congratulations') > 0) {
        $passed++;
    } else {
        error_out("Not found");
    }
} catch (Exception $ex) {
    error_out("The autograder did not find something it was looking for in your HTML - test ended.");
    error_log($ex->getMessage());
    error_log($ex->getTraceAsString());
    $detail = "This indicates the source code line where the test stopped.\n" . "It may not make any sense without looking at the source code for the test.\n" . 'Caught exception: ' . $ex->getMessage() . "\n" . $ex->getTraceAsString() . "\n";
    $OUTPUT->togglePre("Internal error detail.", $detail);
}
$perfect = 10;
$score = webauto_compute_effective_score($perfect, $passed, $penalty);
if (!$titlefound) {
    error_out("These pages do not have proper titles so this grade was not sent");
    return;
}
if ($score > 0.0) {
    webauto_test_passed($score, $url);
}
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:31,代码来源:a03.php


示例7: error_out

*/
function error_out($reason = '')
{
    $error = array('status' => 'failure');
    if ($reason !== '') {
        $error['reason'] = $reason;
    }
    print $error;
    die;
}
if (!empty($LoggedUser['DisableForums'])) {
    error_out('You do not have access to the forums!');
}
$UserID = empty($_GET['userid']) ? $LoggedUser['ID'] : $_GET['userid'];
if (!is_number($UserID)) {
    error_out('User does not exist!');
}
if (isset($LoggedUser['PostsPerPage'])) {
    $PerPage = $LoggedUser['PostsPerPage'];
} else {
    $PerPage = POSTS_PER_PAGE;
}
list($Page, $Limit) = Format::page_limit($PerPage);
$UserInfo = Users::user_info($UserID);
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
$ViewingOwn = $UserID === $LoggedUser['ID'];
$ShowUnread = $ViewingOwn && (!isset($_GET['showunread']) || !!$_GET['showunread']);
$ShowGrouped = $ViewingOwn && (!isset($_GET['group']) || !!$_GET['group']);
if ($ShowGrouped) {
    $SQL = '
		SELECT
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:post_history.php


示例8: load_config

 private function load_config()
 {
     // Load config file or bail out
     if (file_exists('config.php')) {
         require 'config.php';
     } else {
         error_out('No config.php. Please make a copy of config.sample.php and name it config.php and configure it.');
     }
 }
开发者ID:henno,项目名称:varamu,代码行数:9,代码来源:Application.php


示例9: error_out

require_once "config.inc.php";
// 2. check _POST
$_inp = $_POST;
if (!isset($_inp['mid'])) {
    error_out(print_r($_POST, true) . " requires mid");
}
// 3. 檢查 user 是否能刪除此檔
$map = map_get_single($_inp['mid']);
if ($map == null) {
    error_out("no such map" . $_inp['mid']);
}
if ($map['uid'] != $_SESSION['uid']) {
    error_out("you are not the owner");
}
// 3.1 正在搬移資料結構, 或重新整理
$block_msg = map_blocked($out_root, $_SESSION['uid']);
if ($block_msg != null) {
    error_out($block_msg);
}
// 4. 真的刪除/回收
if ($_inp['op'] && $_inp['op'] == 'recycle') {
    $ok = map_expire($_inp['mid']);
} else {
    $ok = map_del($_inp['mid']);
}
if ($ok === FALSE) {
    error_out("delete/expire fail");
}
sleep(1);
$mid = $_inp['mid'];
ok_out("{$mid} deleted", $mid);
开发者ID:KevinStoneCode,项目名称:twmap,代码行数:31,代码来源:backend_del.php


示例10: if

                <li <?php 
echo $controller == 'users' ? 'class="active"' : '';
?>
><a href="users">Users</a></li>

            </ul>

        </div>
        <!--/.nav-collapse -->
    </div>
</div>

<div class="container">

    <!-- Main component for a primary marketing message or call to action -->
    <? if (!file_exists("views/$controller/{$controller}_$action.php")) error_out('The view <i>views/' . $controller . '/' . $controller . '_' . $action . '.php</i> does not exist. Create that file.'); ?>
    <? @require "views/$controller/{$controller}_$action.php"; ?>

</div>
<!-- /container -->


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="vendor/components/jquery/jquery.min.js"></script>
<script src="vendor/components/bootstrap/js/bootstrap.min.js"></script>
<script src="https://mottie.github.io/tablesorter/js/jquery.tablesorter.js"></script>
</body>
</html>
开发者ID:ritika7,项目名称:tablesorter,代码行数:30,代码来源:master_template.php


示例11: line_out

$passed = 0;
$titlefound = false;
try {
    $h1 = $crawler->filter('h1')->text();
    line_out("Found h1 tag...");
} catch (Exception $ex) {
    error_out("Did not find h1 tag");
    $h1 = "";
}
if (stripos($h1, 'Hello') !== false) {
    success_out("Found 'Hello' in the h1 tag");
    $passed += 1;
} else {
    error_out("Did not find 'Hello' in the h1 tag");
}
if ($USER->displayname && stripos($h1, $USER->displayname) !== false) {
    success_out("Found ({$USER->displayname}) in the h1 tag");
    $passed += 1;
} else {
    if ($USER->displayname) {
        error_out("Did not find {$USER->displayname} in the h1 tag");
        error_out("No score sent");
        return;
    }
}
$perfect = 2;
$score = webauto_compute_effective_score($perfect, $passed, $penalty);
// Send grade
if ($score > 0.0) {
    webauto_test_passed($score, $url);
}
开发者ID:ixtel,项目名称:tsugi,代码行数:31,代码来源:a02.php


示例12: exec

exec($cmd, $output, $ret);
if ($ret != 0) {
    foreach ($output as $line) {
        if (strstr($line, "err:")) {
            $errline .= substr($line, 4) . "\n";
        }
    }
    error_out($errline);
}
// before register, check count again
if (map_full($_SESSION['uid'], $user['limit'], $recreate_flag)) {
    $files = map_files($outimage);
    foreach ($files as $f) {
        @unlink($f);
    }
    error_out("已經達到數量限制" . $user['limit']);
}
$type = determine_type($shiftx, $shifty);
$outx = ceil($shiftx / $tiles[$type]['x']);
$outy = ceil($shifty / $tiles[$type]['y']);
if (file_exists(str_replace(".tag.png", ".gpx", $outimage))) {
    $save_gpx = 1;
}
$mid = map_add($_SESSION['uid'], $title, $xx, $yy, $shiftx, $shifty, $outx, $outy, $_SERVER['REMOTE_ADDR'], $outimage, map_size($outimage), $version, $save_gpx);
// 最後搬移到正確目錄
map_migrate($out_root, $_SESSION['uid'], $mid);
// 如果有 gpx 就 import 到 gis 的 database 中
//if ($svg_params != "") {
//	import_gpx($mid);
//}
$okmsg = msglog("done");
开发者ID:KevinStoneCode,项目名称:twmap,代码行数:31,代码来源:backend_make.php


示例13: load_config

 private function load_config()
 {
     // Load config file or bail out
     if (file_exists(dirname(__FILE__) . '/../../config.php')) {
         include dirname(__FILE__) . '/../../config.php';
     } else {
         error_out('No config.php. Please make a copy of config.sample.php and name it config.php and configure it.');
     }
 }
开发者ID:Aphyxia,项目名称:halo,代码行数:9,代码来源:Application.php


示例14: line_out

        $url = false;
        line_out("Looking for Logout Anchor Tag.");
        $link = $crawler->selectLink('Logout')->link();
        $url = $link->getURI();
    }
    line_out("Retrieving " . htmlent_utf8($url) . "...");
    $crawler = $client->request('GET', $url);
    $html = $crawler->html();
    $OUTPUT->togglePre("Show retrieved page", $html);
    $passed++;
    line_out("Looking for login link.");
    $link = $crawler->selectLink('Log In')->link();
    $url = $link->getURI();
    $passed++;
} catch (Exception $ex) {
    error_out("The autograder did not find something it was looking for in your HTML - test ended.");
    error_log($ex->getMessage());
    error_log($ex->getTraceAsString());
    $detail = "This indicates the source code line where the test stopped.\n" . "It may not make any sense without looking at the source code for the test.\n" . 'Caught exception: ' . $ex->getMessage() . "\n" . $ex->getTraceAsString() . "\n";
    $OUTPUT->togglePre("Internal error detail.", $detail);
}
// There is a maximum of 20 passes for this test
$perfect = 20;
$score = webauto_compute_effective_score($perfect, $passed, $penalty);
if (!$titlefound) {
    error_out("These pages do not have proper titles so this grade is not official");
    return;
}
if ($score > 0.0) {
    webauto_test_passed($score, $url);
}
开发者ID:ixtel,项目名称:tsugi,代码行数:31,代码来源:a05.php


示例15: success_out

$grade = 0.0;
if (strpos($h1, "Dr. Chuck") !== false) {
    $failure = "You need to put your own name in the h1 tag - assignment not complete!";
} else {
    if (strpos($h1, 'Hello') !== false) {
        $success = "Found 'Hello' in the h1 tag - assignment correct!";
        $grade = 1.0;
    } else {
        $failure = "Did not find 'Hello' in the h1 tag - assignment not complete!";
    }
}
if (strlen($success) > 0) {
    success_out($success);
    error_log($success);
} else {
    if (strlen($failure) > 0) {
        error_out($failure);
        error_log($failure);
        exit;
    } else {
        error_log("No status");
        exit;
    }
}
// Send grade
if ($penalty !== false) {
    $grade = $grade * (1.0 - $penalty);
}
if ($grade > 0.0) {
    webauto_test_passed($grade, $url);
}
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:31,代码来源:assn02.php


示例16: getTableColumns

 public function getTableColumns($create = true)
 {
     global $db;
     // Make sure we have a table set
     if ($this->table == "") {
         error_out("No table set.");
         return false;
     }
     $sql = new SQLQuery($this->table);
     $sql->international = $this->international;
     $columns = $sql->get_columns();
     if (!empty($columns)) {
         // Table exists -- return the columns
         $this->tablecolumns = $columns;
         // If table exists and create is set, add any additional columns
         if ($create) {
             $formcolumns = $this->formToTableColumns(false);
             $newcolumns = array_diff(array_keys($formcolumns), array_keys($columns));
             if (!empty($newcolumns)) {
                 $tablename = $this->table;
                 if ($this->schema != "") {
                     $tablename = $this->schema . "." . $this->table;
                 }
                 $alter_table_column_string = "";
                 foreach ($newcolumns as $colname) {
                     if ($alter_table_column_string != "") {
                         $alter_table_column_string .= ",";
                     }
                     $alter_table_column_string .= $colname . " " . $formcolumns[$colname];
                     $this->tablecolumns[$colname] = $formcolumns[$colname];
                 }
                 $alter_table_query = "ALTER TABLE " . $tablename . " ADD(" . $alter_table_column_string . ")";
                 $ret = $db->execute($alter_table_query);
             }
         }
         return $this->tablecolumns;
     } else {
         if ($create) {
             // Table doesn't exist -- create it from form
             $this->tablecolumns = $this->formToTableColumns();
             $sql_create = new SQLCreate($this->table, $this->tablecolumns);
             $sql_create->international = $this->international;
             $sql_create->execute();
             return $this->tablecolumns;
         } else {
             // Table doesn't exist, 'create' set to false: return false
             error_out("Table doesn't exist.");
             return false;
         }
     }
 }
开发者ID:hughlaura,项目名称:php_oracle_handytools,代码行数:51,代码来源:Form.class.php


示例17: error_out

            error_out("Did not find '{$displayname}' in title tag");
            $success = false;
            break;
        }
    }
    $matches = array();
    preg_match('/Your Play=([^ ]*) Computer Play=([^ ]*) Result=(.*)/', $html, $matches);
    if (count($matches) != 4) {
        error_out('Could not find properly formatted line starting with "Your Play="');
        continue;
    }
    line_out('Found:' . $matches[0]);
    if (check($matches)) {
        success_out('Correct play');
    } else {
        error_out('Incorrect play');
        $success = false;
    }
}
if (!$success) {
    error_out('Please fix and re-test.');
    exit;
}
// Send a grade if requested
$grade = 1.0;
if ($penalty !== false) {
    $grade = $grade * (1.0 - $penalty);
}
if ($grade > 0.0) {
    webauto_test_passed($grade, $url);
}
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:31,代码来源:assn03.php


示例18: mysql_query

        $where2 .= "`a`.`group` = '{$grp}'";
        $where2 .= $where3;
        $x++;
    }
}
$where2 .= "AND `a`.`type` = 1";
$query = "SELECT * FROM `{$GLOBALS['mysql_prefix']}assigns` `as`\n\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}ticket` `t` ON `as`.`ticket_id` = `t`.`id`\n\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}allocates` `a` ON `t`.`id` = `a`.`resource_id`\t\t\n\t\tWHERE `as`.`user_id` != {$me} {$where2} ORDER BY `as`.`as_of` DESC LIMIT 1";
// get most recent
$result = mysql_query($query) or error_out(basename(__FILE__) . "@" . __LINE__);
// 2/10/12
$assign_row = mysql_affected_rows() > 0 ? stripslashes_deep(mysql_fetch_assoc($result)) : FALSE;
// 2/25/12 - AS
$query = "SELECT `updated` FROM `{$GLOBALS['mysql_prefix']}action` WHERE `updated` = ( SELECT MAX(`updated`) FROM `{$GLOBALS['mysql_prefix']}action` ) LIMIT 1";
$result = mysql_query($query) or error_out(basename(__FILE__) . "@" . __LINE__);
// 2/10/12
$act_row = mysql_affected_rows() > 0 ? stripslashes_deep(mysql_fetch_assoc($result)) : FALSE;
$query = "SELECT `updated` FROM `{$GLOBALS['mysql_prefix']}patient` WHERE `updated` = ( SELECT MAX(`updated`) FROM `{$GLOBALS['mysql_prefix']}patient` ) LIMIT 1";
$result = mysql_query($query) or error_out(basename(__FILE__) . "@" . __LINE__);
// 2/10/12
$pat_row = mysql_affected_rows() > 0 ? stripslashes_deep(mysql_fetch_assoc($result)) : FALSE;
$the_act_id = $act_row ? $act_row['updated'] : "0";
// action item
$the_pat_id = $pat_row ? $pat_row['updated'] : "0";
// patient item
$the_unit_id = $row ? $row['id'] : "0";
$the_updated = $row ? $row['updated'] : "0";
$the_dispatch_change = $assign_row ? $assign_row['as_of'] : "";
$the_hash = md5($the_chat_id . $the_tick_id . $the_unit_id . $the_updated . $the_dispatch_change . $the_act_id . $the_pat_id);
$ret_arr = array($the_chat_id, $the_tick_id, $the_unit_id, $the_updated, $the_dispatch_change, $the_act_id, $the_pat_id, $the_hash);
print json_encode($ret_arr);
// 1/6/11
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:31,代码来源:get_latest_id.php


示例19: __autoload

function __autoload($className)
{
    (include 'system/classes/' . $className . '.php') or (include 'classes/' . $className . '.php') or error_out("Autoload of class {$className} failed.");
    debug("Autoloaded " . $className);
}
开发者ID:henno,项目名称:varamu,代码行数:5,代码来源:functions.php


示例20: error_out

        if (isset($_REQUEST[$field])) {
            $update->add_value($field, $_REQUEST[$field]);
        }
    }
    if (isset($_REQUEST["password1"]) && $_REQUEST["password1"] != "") {
        if (!isset($_REQUEST["password2"]) && $_REQUEST["password2"] != "") {
            error_out("Please retype password.");
        } else {
            if ($_REQUEST["password1"] != $_REQUEST["password2"]) {
                error_out("Passwords do not match.");
            } else {
                $hash = db_hash_password($_REQUEST['password1']);
                if ($hash) {
                    $update->add_value("pass", $hash);
                } else {
                    error_out("Problem hashing password. Please retry.");
                }
            }
        }
    } else {
        if (isset($_REQUEST["password2"]) && $_REQUEST["password2"] != "") {
            error_out("Please type password in both fields.");
        }
    }
    $update->execute();
    $user->dbGet();
    $rjo->query = $update->query;
    $rjo->status = "success";
    $rjo->successMessage = "Saved user settings.";
}
echo $rjo->printjson();
开发者ID:hughlaura,项目名称:php_oracle_handytools,代码行数:31,代码来源:ajax.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP error_page函数代码示例发布时间:2022-05-15
下一篇:
PHP error_notice函数代码示例发布时间: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