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


PHP _err函数代码示例

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


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

示例1: _get_sipuser

function _get_sipuser($user_id)
{
    global $db;
    $user = $db->executeGetOne('SELECT `name` FROM `ast_sipfriends` WHERE `_user_id`=\'' . $db->escape($user_id) . '\'');
    if (!$user) {
        _err('Unknown sip user.');
    }
    return $user;
}
开发者ID:hehol,项目名称:GemeinschaftPBX,代码行数:9,代码来源:dnd.php

示例2: _get_userid

function _get_userid()
{
	global $_SERVER, $db;
	
	$remote_addr = @$_SERVER['REMOTE_ADDR'];
	$user_id = (int)$db->executeGetOne( 'SELECT `id` FROM `users` WHERE `current_ip`=\''. $db->escape($remote_addr) .'\'' );
	if ($user_id < 1) _err( 'Unknown user.' );
	return $user_id;
}
开发者ID:netkom,项目名称:GemeinschaftPBX,代码行数:9,代码来源:dial-log.php

示例3: _get_user_ext

function _get_user_ext($user_id)
{
    $db = gs_db_slave_connect();
    $user_ext = $db->executeGetOne('SELECT `name` FROM `ast_sipfriends` WHERE `_user_id`=\'' . $db->escape($user_id) . '\'');
    if (!$user_ext) {
        _err('Unknown user.');
        return false;
    }
    return $user_ext;
}
开发者ID:hehol,项目名称:GemeinschaftPBX,代码行数:10,代码来源:login.php

示例4: getUserID

function getUserID($ext)
{
    global $db;
    if (!preg_match('/^\\d+$/', $ext)) {
        _err('Invalid username');
    }
    $user_id = (int) $db->executeGetOne('SELECT `_user_id` FROM `ast_sipfriends` WHERE `name`=\'' . $db->escape($ext) . '\'');
    if ($user_id < 1) {
        _err('Unknown user');
    }
    return $user_id;
}
开发者ID:rkania,项目名称:GS3,代码行数:12,代码来源:configmenu.php

示例5: getUserID

function getUserID($ext)
{
    global $db;
    if (!preg_match("/^\\d+\$/", $ext)) {
        _err("Invalid username");
    }
    $user_id = (int) $db->executeGetOne("SELECT `_user_id` FROM `ast_sipfriends` WHERE `name`='" . $db->escape($ext) . "'");
    if ($user_id < 1) {
        _err("Unknown user");
    }
    return $user_id;
}
开发者ID:hehol,项目名称:GemeinschaftPBX,代码行数:12,代码来源:pb.php

示例6: connect

 private function connect()
 {
     $host = $this->args['host'];
     $port = $this->args['port'];
     $pass = $this->args['pass'];
     @($this->__sock = fsockopen($host, $port, $errno, $errstr));
     if ($this->__sock === false) {
         _err(__CLASS__, 'CONNECTION FAILED - ' . trim($errstr));
     }
     if ($pass) {
         $this->AUTH($pass);
     }
 }
开发者ID:ejz,项目名称:redis,代码行数:13,代码来源:RedisConnector.php

示例7: array

$error_msg = array();
//inizializzo l'array di errori
if (@$_GET['login'] == 1) {
    $username = clear($_POST['username']);
    $password = $_POST['password'];
    if (empty($username) && empty($password)) {
        $error_msg[] = "<font color=red><p><i>Inserire i dati per il Login!</i><p></font>";
    } elseif (login($username, md5($password)) == FALSE) {
        $error_msg[] = "<font color=red><p><i>Dati inseriti Errati!</i><p></font>";
    } elseif (check_maintenance(2) == 1 && level($username) == 'user') {
        $error_msg[] = "<font color=red><p><i>Login Impossibile (Forum in Modalità Manutenzione)</i><p></font>";
    } elseif (login($username, md5($password)) == TRUE && empty($error_msg)) {
        setcookie("0xBB_user", $username);
        setcookie("0xBB_pass", md5($password));
        //aggiorno l'IP dell'utente nel ban_ip
        mysql_query("UPDATE " . __PREFIX__ . "ban_ip \n\t\t\t\t\t\tSET ip = '" . $_SERVER['REMOTE_ADDR'] . "' \n\t\t\t\t\t  WHERE user_id = '" . nick2uid($username) . "'") or _err(mysql_error());
        header("Location: index.php");
        exit;
    } else {
        $error_msg[] = "<font color=red><p><i>Errore di Login! Riprova</i><p></font>";
    }
}
if ($error_msg) {
    print '<div class="error_msg">
		  <h3 align="center">ERRORI nella fase di LOGIN!</h2><br />
	          <br />';
    foreach ($error_msg as $error_message) {
        print $error_message . "<br />\n";
    }
    print "<br />\n<center><a href='javascript:history.back()'>Torna Indietro</a>\n</center>\n</div>\n";
} else {
开发者ID:KinG-InFeT,项目名称:0xBB,代码行数:31,代码来源:login.php

示例8: trim

$url_polycom_dnd = GS_PROV_SCHEME . "://" . GS_PROV_HOST . (GS_PROV_PORT ? ":" . GS_PROV_PORT : "") . GS_PROV_PATH . "polycom/dnd.php";
$newdndstate = trim(@$_REQUEST["setdnd"]);
if ($newdndstate == "on" || $newdndstate == "off") {
    $masterdb = gs_db_master_connect();
    if (!$masterdb) {
        _err("Could not connect to database.");
    }
    if ($newdndstate == "on") {
        $dndvalue = 'yes';
    }
    if ($newdndstate == "off") {
        $dndvalue = 'no';
    }
    $check = $masterdb->execute("INSERT INTO `dnd` (`_user_id`, `active`) VALUES (" . $user_id . ", '" . $db->escape($dndvalue) . "') ON DUPLICATE KEY UPDATE `active` = '" . $db->escape($dndvalue) . "'");
    if (!$check) {
        _err("Failed to set new DND state.");
    }
    if (GS_BUTTONDAEMON_USE == true) {
        gs_dnd_changed_ui($user, $newdndstate);
    }
}
#################################### MAIN MENU {
$current_dndstate = $db->executeGetOne("SELECT `active` FROM `dnd` WHERE `_user_id`=" . $user_id);
echo $mainmenu_doctype . "\n";
echo "<html>\n";
echo "<head><title>" . __("Ruhe/DND") . "</title></head>\n";
echo "<body><br />\n";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\">\n";
echo "<tr>";
echo "<th width=\"100%\" align=\"center\">" . __("Ruhe/DND-Status setzen") . ":</th></tr>\n";
echo "<tr><td width=\"100%\" align=\"center\"><a href=\"" . $url_polycom_dnd . "?m=" . $mac . "&amp;u=" . $user . "&amp;setdnd=on\">" . ($current_dndstate == 'yes' ? "*" : "") . __("Ein") . "</a></td></tr>\n";
开发者ID:hehol,项目名称:GemeinschaftPBX,代码行数:31,代码来源:dnd.php

示例9: karma

function karma($user_id)
{
    global $karma;
    $query = "SELECT vote FROM " . __PREFIX__ . "karma WHERE vote_user_id = '{$user_id}'";
    $res = mysql_query($query) or _err(mysql_error());
    while ($row = mysql_fetch_row($res)) {
        $karma += $row[0];
    }
    if ($karma == NULL) {
        $karma = 0;
    }
    if ($karma > 0) {
        $karma = "<b><font color = 'green'>+{$karma}</font></b>";
    } elseif ($karma < 0) {
        $karma = "<b><font color = 'red'>{$karma}</font></b>";
    } else {
        $karma = "<b><font color = 'grey'>{$karma}</font></b>";
    }
    return $karma;
}
开发者ID:KinG-InFeT,项目名称:0xBB,代码行数:20,代码来源:kernel.php

示例10: gs_loadtextdomain

gs_loadtextdomain('gemeinschaft-gui');
gs_settextdomain('gemeinschaft-gui');
//--- get user_id
$user_id = (int) $db->executeGetOne('SELECT `_user_id` FROM `ast_sipfriends` WHERE `name`=\'' . $db->escape($user) . '\'');
if ($user_id < 1) {
    _err('Unknown user.');
}
//--- check user/ip/mac
$user_id_check = $db->executeGetOne("SELECT `user_id` FROM `phones` WHERE `mac_addr`='" . $db->escape($mac) . "'");
if ($user_id != $user_id_check) {
    _err("Not authorized");
}
$remote_addr = @$_SERVER["REMOTE_ADDR"];
$remote_addr_check = $db->executeGetOne("SELECT `current_ip` FROM `users` WHERE `id`=" . $user_id);
if ($remote_addr != $remote_addr_check) {
    _err("Not authorized");
}
unset($remote_addr_check);
unset($remote_addr);
unset($user_id_check);
$typeToTitle = array("out" => __("Gewählt"), "missed" => __("Verpasst"), "in" => __("Angenommen"));
ob_start();
$url_polycom_dl = GS_PROV_SCHEME . '://' . GS_PROV_HOST . (GS_PROV_PORT ? ':' . GS_PROV_PORT : '') . GS_PROV_PATH . 'polycom/diallog.php';
if (isset($delete) && $type) {
    //--- clear list (
    $db->execute('DELETE FROM `dial_log` ' . 'WHERE ' . '  `user_id`=' . $user_id . ' AND ' . '  `type`=\'' . $type . '\'');
    //--- ) clear list
}
#################################### INITIAL SCREEN {
if (!$type) {
    //--- delete outdated entries
开发者ID:hehol,项目名称:GemeinschaftPBX,代码行数:31,代码来源:diallog.php

示例11: kona3plugins_comment_action_write

function kona3plugins_comment_action_write($page)
{
    global $output_format;
    $bbs_id = isset($_POST['bbs_id']) ? $_POST['bbs_id'] : '';
    $name = isset($_POST['name']) ? $_POST['name'] : '';
    $body = isset($_POST['body']) ? $_POST['body'] : '';
    $pw = isset($_POST['pw']) ? $_POST['pw'] : '';
    //
    $bbs_id = intval($bbs_id);
    if ($body == '' || $bbs_id <= 0) {
        _err($page, 'Invalid data');
        exit;
    }
    if ($name == '') {
        $name = 'no name';
    }
    $pdo = kona3getDB();
    $stmt = $pdo->prepare("INSERT INTO comment_list(bbs_id, name, body, delkey, ctime, mtime)" . "VALUES(?, ?, ?, ?, ?, ?)" . "");
    $a = array($bbs_id, $name, $body, $pw, time(), time());
    $r = $stmt->execute($a);
    $_SESSION['name'] = $name;
    $_SESSION['password'] = $pw;
    // show result
    if ($output_format == "json") {
        _ok($page, "inserted");
    }
    // jump
    header("location: index.php?" . urlencode($page));
}
开发者ID:kujirahand,项目名称:konawiki3,代码行数:29,代码来源:comment.inc.php

示例12: CustomQuery

 /**
  * custom query
  * @todo Select from database
  * @param string $sql An SQL string
  * @param array $array Paramters to bind
  * @param constant $fetchMode A PDO Fetch mode
  * @return mixed
  */
 public function CustomQuery($sql, $array = array(), $fetchMode = PDO::FETCH_ASSOC)
 {
     //remove type
     if (isset($array['type'])) {
         unset($array['type']);
     }
     //send sql
     $stmt = $this->prepare($sql);
     // send params
     foreach ($array as $key => $value) {
         $stmt->bindValue("{$key}", $value);
     }
     // run sql
     $success = $stmt->execute();
     // dubug unsuccess
     if (_DBG_ && !$success) {
         _err(array_merge($stmt->errorInfo(), array($sql)));
     }
     return $stmt->fetchAll($fetchMode);
 }
开发者ID:A1Gard,项目名称:ToosFrameWork,代码行数:28,代码来源:TDatabasePDO.php

示例13: mysql_query

    case '15':
        @($position = (int) $_GET['position']);
        @($real_position = (int) $_GET['real_position']);
        @($f_id = (int) $_GET['f_id']);
        if ($position && $f_id && $real_position) {
            // nuova posizione
            $new_position = $real_position + $position;
            $query = "UPDATE " . __PREFIX__ . "forum SET position = " . $real_position . " WHERE position = " . $new_position;
            $res = mysql_query($query) or _err(mysql_error());
            $query = "UPDATE " . __PREFIX__ . "forum SET position = " . $new_position . " WHERE id = " . $f_id;
            $res = mysql_query($query) or _err(mysql_error());
            header("Location: admin.php?mode=15");
        } else {
            print "\n<h2 align=\"center\">Posizionamento dei Forum</h2><br /><br />" . "\n<table align=\"center\">" . "\n<tr>" . "\n\t<td class=\"users\"> Titolo</td>" . "\n\t<td class=\"users\">Descrizione</td>" . "\n\t<td class=\"users\">Sposta</td>" . "\n</tr>";
            $query = "SELECT * FROM " . __PREFIX__ . "forum ORDER BY position";
            $res = mysql_query($query) or _err(mysql_error());
            while ($row = mysql_fetch_array($res)) {
                print "\n<tr>" . "\n\t<td class=\"users\">" . $row['title'] . "</td>" . "\n\t<td class=\"users\">" . $row['description'] . "</td>" . "\n\t<td class=\"users\"><a href=\"admin.php?mode=15&position=-1&f_id=" . $row['id'] . "&real_position=" . $row['position'] . "\">[SU]</a> -" . "\n\t<a href=\"admin.php?mode=15&position=1&f_id=" . $row['id'] . "&real_position=" . $row['position'] . "\">[GIU]</a></td>" . "\n</tr>";
            }
            print "\n</table>";
        }
        break;
    default:
        ?>
		<p><b>Pannello di Controllo Amministratore:</b></p>
		-> <a href = 'admin.php?mode=1'>Gestione Forums</a><br />
    	-> <a href = 'admin.php?mode=15'>Gestione Posizione Forums</a><br />
		-> <a href = 'admin.php?mode=2'>Aggiungi/Rimuovi Amministratori</a><br />
		-> <a href = 'admin.php?mode=5'>Aggiungi/Rimuovi Moderatori</a><br />	
		-> <a href = 'admin.php?mode=14'>Aggiungi/Rimuovi Utenti VIP</a><br />		
		-> <a href = 'admin.php?mode=3'>Cancella Utente</a><br />
开发者ID:KinG-InFeT,项目名称:0xBB,代码行数:31,代码来源:admin.php

示例14: mysql_fetch_row

				<br />
				<input type = 'submit' value = 'Invia'>
			</form>
			<?php 
        }
        break;
    case 4:
        $id = (int) $_GET['id'];
        $query = "SELECT to_usr FROM " . __PREFIX__ . "pm WHERE id = '" . $id . "'";
        $row = mysql_fetch_row(mysql_query($query));
        if ($row[0] == $username) {
            $query = "DELETE FROM " . __PREFIX__ . "pm WHERE id = '" . $id . "'";
            mysql_query($query) or die("SQL Error:" . mysql_error());
            header("Location: pm.php");
        } else {
            _err("<b>Errore!</b>Non sei autorizzato a leggere questo PM!");
        }
        break;
    default:
        header("Location: pm.php?mode=1");
        break;
}
?>
</div>
</div>
<?php 
footer();
?>
</body>
</html>
开发者ID:KinG-InFeT,项目名称:0xBB,代码行数:30,代码来源:pm.php

示例15: _err

    _err("Not enabled.");
}
$mac = preg_replace("/[^\\dA-Z]/", "", strtoupper(trim(@$_REQUEST["mac"])));
$user = trim(@$_REQUEST["user"]);
if (!preg_match("/^\\d+\$/", $user)) {
    _err("Not a valid SIP user.");
}
$db = gs_db_slave_connect();
// setup i18n stuff
gs_setlang(gs_get_lang_user($db, $user, GS_LANG_FORMAT_GS));
gs_loadtextdomain('gemeinschaft-gui');
gs_settextdomain('gemeinschaft-gui');
//--- get user_id
$user_id = (int) $db->executeGetOne("SELECT `_user_id` FROM `ast_sipfriends` WHERE `name`='" . $db->escape($user) . "'");
if ($user_id < 1) {
    _err("Unknown user.");
}
$menuitems = array(array("file" => "diallog.php?user=" . $user . "&amp;mac=" . $mac, "title" => __("Ruflisten")), array("file" => "pb.php?u=" . $user . "&amp;m=" . $mac, "title" => __("Telefonbuch")), array("file" => "configmenu.php?u=" . $user . "&amp;m=" . $mac, "title" => __("Konfiguration")));
ob_start();
$url_polycom_base = GS_PROV_SCHEME . "://" . GS_PROV_HOST . (GS_PROV_PORT ? ":" . GS_PROV_PORT : "") . GS_PROV_PATH . "polycom/";
#################################### MAIN MENU {
echo $mainmenu_doctype . "\n";
echo "<html>\n";
echo "<head><title>" . __("Telefonmenü") . "</title></head>\n";
echo "<body><br />\n";
foreach ($menuitems as $thismenuitem) {
    echo "- <a href=\"" . $url_polycom_base . $thismenuitem["file"] . "\">" . $thismenuitem["title"] . "</a><br />\n";
}
echo "</body>\n";
echo "</html>\n";
#################################### MAIN MENU }
开发者ID:hehol,项目名称:GemeinschaftPBX,代码行数:31,代码来源:main.php


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