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


PHP err函数代码示例

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


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

示例1: connect

/** Connects to a database, we don't need a link for our purposes */
function connect()
{
    mysql_connect(DB_SERVER, DB_USER, DB_PASS) or err("failure connecting to database...");
    if (!@mysql_select_db(DB)) {
        err("failure selecting the database <strong>" . DB . "</strong>...");
    }
}
开发者ID:ralphleon,项目名称:Pollinator,代码行数:8,代码来源:database_helper.php

示例2: get

 public static function get($require, $what = null)
 {
     // $routes_array = [];
     if ($require == 1) {
         require "site_routes/site_routes_common.php";
     } elseif ($require == 2) {
         require "site_routes/site_routes_pages.php";
     } elseif ($require == 3) {
         require "site_routes/site_routes_projects.php";
     } elseif ($require == 4) {
         require "site_routes/site_routes_hidden.php";
     } elseif ($require == 5) {
         require "site_routes/site_routes_siteTests.php";
     } elseif ($require == 6) {
         require "site_routes/site_routes_api.php";
     } elseif ($require == 7) {
         require "site_routes/site_routes_spidro.php";
     } elseif ($require == 8) {
         require "site_routes/site_routes_sellingManager.php";
     } elseif ($require == 9) {
         require "site_routes/site_routes_games.php";
     } else {
         err("not a defined site route");
     }
     // err($require."--".$what);
     // err($routes_array[$what]);
     if ($what == null) {
         $ans = $routes_array;
     } else {
         $ans = $routes_array[$what];
     }
     return $ans;
 }
开发者ID:Ahmed-Badawy,项目名称:ahmed-badawy.com-Website,代码行数:33,代码来源:site_routes.php

示例3: urandom_bytes

 function urandom_bytes($num)
 {
     if ($num < 0) {
         err("NUM must be nonnegative in urandom_bytes");
     }
     if ($this->use_urandom && !$this->urandom_filehandle) {
         $file = @fopen("/dev/urandom", "r");
         if (!$file) {
             $this->use_urandom = false;
         } else {
             $this->urandom_filehandle = $file;
         }
     }
     $res = '';
     if ($this->use_urandom) {
         while (strlen($res) < $num) {
             $res .= fread($this->urandom_filehandle, $num - strlen($res));
         }
     } else {
         for ($i = 0; $i < $num; $i++) {
             $res .= chr(mt_rand(0, 255));
         }
     }
     return $res;
 }
开发者ID:billstclair,项目名称:trubanc,代码行数:25,代码来源:LoomRandom.php

示例4: query

 function query($sql)
 {
     if (!($res = @mysql_query($sql, $this->link))) {
         err('操作数据库失败' . mysql_error() . "<br>sql:{$sql}", "javascript:history.go(-1);");
     }
     return $res;
 }
开发者ID:BGCX261,项目名称:zhuoao-svn-to-git,代码行数:7,代码来源:mysql.class.php

示例5: survey_do_command

function survey_do_command($command, $user_code, $auth_signature)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
    curl_setopt($ch, CURLOPT_USERAGENT, 'PHP survey client, version $Id: survey.php,v 1.3 2008-06-24 16:41:21 francis Exp $');
    curl_setopt($ch, CURLOPT_URL, OPTION_SURVEY_URL);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "{$command}&user_code=" . urlencode($user_code) . "&auth_signature=" . urlencode($auth_signature));
    $r = curl_exec($ch);
    if ($r === FALSE) {
        err(curl_error($ch) . " curling " . OPTION_SURVEY_URL);
    }
    $errcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($errcode != 200) {
        err("Error {$errcode} curling " . OPTION_SURVEY_URL);
    }
    curl_close($ch);
    $r = trim($r);
    if ($r == "1") {
        return true;
    } elseif ($r == "0") {
        return false;
    } else {
        err("Error returned from survey service: " . $r);
    }
}
开发者ID:palfrey,项目名称:phplib,代码行数:27,代码来源:survey.php

示例6: pgerr

function pgerr( $err )
{
  $e = pg_last_error();
  if( $e == '' ) $e = $err;
  if( $e == '' ) $e = 'unknown pgsql error';
  pg_free_result( pg_query( 'ROLLBACK' ) );
  err( $e );
}
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:8,代码来源:emsproxy.php

示例7: fun_refused_nocomments

 function fun_refused_nocomments($comment_data)
 {
     $pattern = '/[一-龥]/u';
     if (!preg_match($pattern, $comment_data['comment_content'])) {
         err('评论必须含中文!');
     }
     return $comment_data;
 }
开发者ID:xiapistudio,项目名称:change,代码行数:8,代码来源:theme-functions.php

示例8: dbconn

function dbconn()
{
    global $TBDEV;
    if (!@mysql_connect($TBDEV['mysql_host'], $TBDEV['mysql_user'], $TBDEV['mysql_pass'])) {
        err('Please call back later');
    }
    mysql_select_db($TBDEV['mysql_db']) or err('Please call back later');
}
开发者ID:scriptzteam,项目名称:SCENE-SCRiPTS,代码行数:8,代码来源:func.php

示例9: dbconn

function dbconn()
{
    global $mysql_host, $mysql_user, $mysql_pass, $mysql_db;
    if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass)) {
        err('Please call back later');
    }
    mysql_select_db($mysql_db) or err('Please call back later!');
}
开发者ID:CtrlSystem,项目名称:biotorrents,代码行数:8,代码来源:announce.php

示例10: __construct

 public function __construct()
 {
     // Connect to DB server
     $this->dbConn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or err("Could not connect to database " . mysql_errno());
     // Set charset
     mysql_set_charset("utf8") or err("Could not set character set " . $this->getLastErrNo());
     // Select DB
     mysql_select_db(DB_NAME) or err("Could not select database \"" . DB_NAME . "\" error code" . $this->getLastErrNo());
 }
开发者ID:a97marbr,项目名称:SvenSYS,代码行数:9,代码来源:DBInterface.php

示例11: eyecandyConsole

 function eyecandyConsole($consoleObject)
 {
     if (method_exists($consoleObject, "getBuffer")) {
         $consoleObject->getBuffer();
     } else {
         err("System console object invalid", "EyecandyConsole() got an invalid system console object.\nThis is unlikely to happen without *ANY* reason, please contact the administrator!", $CONFIG['DebugLevel'] + 1);
     }
     $this->buffer .= '<div class="eyecandyConsole">' . $consoleObject->getBuffer() . '</div>';
 }
开发者ID:BackupTheBerlios,项目名称:twonineothree-svn,代码行数:9,代码来源:xhtmlbody.php

示例12: ResetPass

function ResetPass()
{
    global $msql, $SiteUrl;
    global $strLostpassNtc1, $strLostpassNtc2, $strLostpassNtc3, $strLostpassNtc4, $strLostpassNtc5;
    global $strLostpassNtc6, $strLostpassNtc7, $strLostpassNtc8, $strLostpassNtc9;
    $coltitle = $GLOBALS["PLUSVARS"]["coltitle"];
    $tempname = $GLOBALS["PLUSVARS"]["tempname"];
    $Temp = LoadTemp($tempname);
    $step = $_REQUEST["step"];
    if ($step == "checkmail") {
        $codestr = $_GET["codestr"];
        $username = $_GET["username"];
        $tm = $_GET["tm"];
        if (!isset($_COOKIE["NEWPASSWD"]) || $_COOKIE["NEWPASSWD"] == "") {
            $PageMain = err($strLostpassNtc7, "lostpass.php", "");
            return $PageMain;
        }
        $md5 = md5($username . "Z(o)C~LoSbZ8Tj7MvBAs(8)!nn^Lp^12345^Pm" . $_COOKIE["NEWPASSWD"] . $tm);
        if ($md5 == $codestr) {
            $mdpass = md5($_COOKIE["NEWPASSWD"]);
            $msql->query("update {P}_member set password='{$mdpass}' where user='{$username}'");
            $PageMain = SayOk($strLostpassNtc8, "login.php", "");
            return $PageMain;
        } else {
            $PageMain = err($strLostpassNtc9, "lostpass.php", "");
            return $PageMain;
        }
    } elseif ($step == "2") {
        $username = $_POST["username"];
        $newpass = $_POST["newpass"];
        if (!isset($username) || $username == "" || $newpass == "") {
            $str = err($strLostpassNtc1, "", "");
            return $str;
        } else {
            $msql->query("select email from {P}_member where user='{$username}'");
            if ($msql->next_record()) {
                $email = $msql->f('email');
                $tm = time();
                setCookie("NEWPASSWD", $newpass, time() + 7200);
                $md5 = md5($username . "Z(o)C~LoSbZ8Tj7MvBAs(8)!nn^Lp^12345^Pm" . $newpass . $tm);
                $link = $SiteUrl . "lostpass.php?step=checkmail&username=" . $username . "&codestr=" . $md5 . "&tm=" . $tm;
                $message = $username . $strLostpassNtc2 . "\r\n \r\n" . $strLostpassNtc3 . "\r\n \r\n" . $link . "\r\n \r\n" . $GLOBALS["CONF"]["SiteName"] . "\r\n" . $GLOBALS["CONF"]["SiteHttp"];
                include ROOTPATH . "includes/ebmail.inc.php";
                ebmail($email, $GLOBALS["CONF"]["SiteEmail"], $strLostpassNtc4, $message);
                $str = SayOk($strLostpassNtc5 . "<br><br>" . $email, "", "");
                return $str;
            } else {
                $str = err($strLostpassNtc6, "", "");
                return $str;
            }
        }
    } else {
        $var = array('coltitle' => $coltitle);
        $str = ShowTplTemp($Temp, $var);
        return $str;
    }
}
开发者ID:noikiy,项目名称:cxe,代码行数:57,代码来源:ResetPass.php

示例13: doAdd

 public function doAdd($user_id)
 {
     if (!me()->hasPermissionTo('add', 'Recommendation')) {
         err('You don\'t have permission to leave a recommendation for that user.');
         return Redirect::to(URL::previous());
     }
     $recommendation = new Recommendation();
     return $recommendation->validateAndUpdateFromArray(Input::all());
 }
开发者ID:omusico,项目名称:lafayettehelps.com,代码行数:9,代码来源:RecommendationController.php

示例14: ratty_test

function ratty_test($scope, $vals)
{
    if (!isset($scope)) {
        err("SCOPE must be supplied");
    }
    debug("RATTY", "Rate limiting", $vals);
    $res = ratty_do_call('test', array($scope, $vals));
    debug("RATTYRESULT", "Result is:", $res);
    return $res;
}
开发者ID:bruno,项目名称:openaustralia-app,代码行数:10,代码来源:ratty.php

示例15: getRec

function getRec($s)
{
    global $reci;
    $reci = isset($reci) ? $reci + 1 : 1;
    $rec = $s[$reci - 1];
    if (substr($rec, 500, 8) != $reci) {
        err("bad seq num at {$reci}");
    }
    return $rec;
}
开发者ID:maduhu,项目名称:rCredits,代码行数:10,代码来源:test1099.php


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