本文整理汇总了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>...");
}
}
示例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;
}
示例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;
}
示例4: query
function query($sql)
{
if (!($res = @mysql_query($sql, $this->link))) {
err('操作数据库失败' . mysql_error() . "<br>sql:{$sql}", "javascript:history.go(-1);");
}
return $res;
}
示例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);
}
}
示例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 );
}
示例7: fun_refused_nocomments
function fun_refused_nocomments($comment_data)
{
$pattern = '/[一-龥]/u';
if (!preg_match($pattern, $comment_data['comment_content'])) {
err('评论必须含中文!');
}
return $comment_data;
}
示例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');
}
示例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!');
}
示例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());
}
示例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>';
}
示例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;
}
}
示例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());
}
示例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;
}
示例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;
}