本文整理汇总了PHP中error_message函数的典型用法代码示例。如果您正苦于以下问题:PHP error_message函数的具体用法?PHP error_message怎么用?PHP error_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了error_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_results
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
global $nb_per_page;
global $base_url;
global $caller;
global $callback;
global $msg;
global $charset;
global $no_display;
// on récupére le nombre de lignes qui vont bien
if (!$id) {
if ($user_input == "") {
$requete = "SELECT COUNT(1) FROM publishers where ed_id!='{$no_display}'";
} else {
$aq = new analyse_query(stripslashes($user_input));
if ($aq->error) {
error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message));
exit;
}
$requete = $aq->get_query_count("publishers", "ed_name", "index_publisher", "ed_id", "ed_id!='{$no_display}'");
}
$res = mysql_query($requete, $dbh);
$nbr_lignes = @mysql_result($res, 0, 0);
} else {
$nbr_lignes = 1;
}
if (!$page) {
$page = 1;
}
$debut = ($page - 1) * $nb_per_page;
if ($nbr_lignes) {
// on construit la vraie requête
if (!$id) {
if ($user_input == "") {
$requete = "SELECT * FROM publishers where ed_id!='{$no_display}' ORDER BY index_publisher LIMIT {$debut},{$nb_per_page} ";
} else {
$members = $aq->get_query_members("publishers", "ed_name", "index_publisher", "ed_id");
$requete = "select *," . $members["select"] . " as pert from publishers where " . $members["where"] . " and ed_id!='{$no_display}' group by ed_id order by pert desc,index_publisher limit {$debut},{$nb_per_page}";
}
} else {
$requete = "select * from publishers where ed_id='" . $id . "'";
}
$res = @mysql_query($requete, $dbh);
while ($ed = mysql_fetch_object($res)) {
$editeur = new editeur($ed->ed_id);
print pmb_bidi("\n \t\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$ed->ed_id}', '" . htmlentities(addslashes($editeur->display), ENT_QUOTES, $charset) . "','{$callback}')\">" . htmlentities($editeur->display, ENT_QUOTES, $charset) . "</a><br />");
}
mysql_free_result($res);
// constitution des liens
$nbepages = ceil($nbr_lignes / $nb_per_page);
$suivante = $page + 1;
$precedente = $page - 1;
// affichage pagination
print "<div class='row'> <hr /></div><div align='center'>";
$url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
$nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
print $nav_bar;
print "</div>";
}
}
示例2: github
public function github()
{
//this function needs to be called wherever your redirect_uri goes to
$is_authorized = $this->github->authorize();
//Login failed!
if (!$is_authorized) {
$this->session->set_flashdata('message', error_message($this->github->get_error()));
redirect(base_url(), 'location');
} else {
//show how to get access token from session here
$github_user = $this->github->user();
$user = array('github_id' => $github_user->id, 'name' => $github_user->name, 'email' => $github_user->email, 'login' => $github_user->login, 'type' => $github_user->type, 'company' => $github_user->company, 'avatar_url' => $github_user->avatar_url, 'hireable' => $github_user->hireable, 'blog' => $github_user->blog, 'bio' => $github_user->bio, 'gravatar_id' => $github_user->gravatar_id, 'location' => $github_user->location, 'access_token' => $this->github->get_access_token());
// Checks to see if the user exists already
// $this->load->model('users_model');
// $db_user = $this->users_model->get_user_by('github_id', $github_user->id);
// If User exists update otherwise create a new record
// if ($db_user)
// {
// $this->users_model->update($db_user->id, $user);
// }
// else
// {
// $this->users_model->create($user);
// }
// For the purpose of example, we store everything in the session instead of the database
$this->session->set_userdata($user);
$this->session->set_flashdata('message', 'Boom! You\'re logged in! Welcome.');
redirect('secure', 'location');
}
}
示例3: get_XML_file
/**
* Get XML file object from hashed project file name
* @param $fileHash: md5 hashed project name
* $projectFile: project file name ( empty var passed by reference )
* @return XML project file object
*/
function get_XML_file($fileHash, &$projectFile)
{
try {
$projects = scandir("../projects");
$projects = array_diff($projects, array('.', '..'));
$userProject = $fileHash;
$projectFile = null;
foreach ($projects as $project) {
if ($userProject == md5($project)) {
$projectFile = $project;
break;
}
}
if (!$projectFile) {
throw new RuntimeException('Project file not found.');
}
// validate simpleXML extension enabled
if (!function_exists(simpleXML_load_file)) {
throw new RuntimeException('Please, enable simplexml extention in your php.ini configuration file.');
}
// validate that the file is not corrupted
@($xmlFile = simpleXML_load_file("../projects/{$projectFile}"));
if (!$xmlFile) {
throw new RuntimeException('Invalid axp file.');
}
return $xmlFile;
} catch (RuntimeException $e) {
echo "<br>" . error_message($e->getMessage());
exit;
}
}
示例4: show_results
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
global $nb_per_page;
global $base_url;
global $caller;
global $msg;
global $no_display;
global $charset;
// on récupére le nombre de lignes qui vont bien
if ($user_input == "") {
$requete = "SELECT COUNT(1) FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' ";
} else {
$aq = new analyse_query(stripslashes($user_input));
if ($aq->error) {
error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message));
exit;
}
$members = $aq->get_query_members("notices", "index_wew", "index_sew", "notice_id");
$requete = "select count(notice_id) from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1'";
}
$res = pmb_mysql_query($requete, $dbh);
$nbr_lignes = @pmb_mysql_result($res, 0, 0);
if (!$page) {
$page = 1;
}
$debut = ($page - 1) * $nb_per_page;
if ($nbr_lignes) {
// on lance la vraie requête
if ($user_input == "") {
$requete = "SELECT notice_id, tit1, code FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' ORDER BY tit1, code LIMIT {$debut},{$nb_per_page} ";
} else {
$requete = "select notice_id, tit1, code, " . $members["select"] . " as pert from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' group by notice_id order by pert desc, index_serie, tnvol, index_sew, code limit {$debut},{$nb_per_page}";
}
$res = @pmb_mysql_query($requete, $dbh);
print "<table><tr>";
while ($notice = pmb_mysql_fetch_object($res)) {
$notice_entry = $notice->tit1 . " " . $notice->code;
print "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$notice->notice_id}', '" . htmlentities(addslashes($notice->tit1), ENT_QUOTES, $charset) . " ({$notice->code})')\">" . htmlentities($notice->tit1, ENT_QUOTES, $charset) . "</a></td>\n\t\t\t\t\t<td>{$notice->code}</td>";
print "</tr>";
}
print "</table>";
pmb_mysql_free_result($res);
// constitution des liens
$nbepages = ceil($nbr_lignes / $nb_per_page);
$suivante = $page + 1;
$precedente = $page - 1;
}
// affichage de la pagination
print "<div class='row'> <hr /></div><div align='center'>";
$url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
$nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
print $nav_bar;
print "</div>";
}
示例5: open_file
function open_file($dir, $fileName)
{
if (!$fileName) {
error_message("Файл не выбран");
}
$dirW = iconv('UTF-8', 'CP1251', $dir);
$fileW = iconv('UTF-8', 'CP1251', $fileName);
if (!is_file("{$dirW}/{$fileW}")) {
error_message("Невозможно открыть файл {$fileName}");
}
return htmlspecialchars(file_get_contents("{$dirW}/{$fileW}"));
}
示例6: gettemplate
function gettemplate($template, $replace, $endung, $folder)
{
return;
if (file_exists($folder . "/" . $template . "." . $endung)) {
// Tag anpassen
$replace = add_tag($replace);
$templatecontent = strtr(implode("", file($folder . "/" . $template . "." . $endung)), $replace);
} else {
error_message("Template nicht gefunden: " . $folder . "/" . $template . "." . $endung);
}
return $templatecontent;
}
示例7: familyValues
function familyValues($arg)
{
$result = mysql_query("select familyvalues.description, toname,\n\t\tcharacterinfo.name \n\t\tfrom family, familyvalues, characterinfo \n\t\twhere family.name =\n\t\t'" . quote_smart($_REQUEST["name"]) . "' and \n\t\tfamily.description = familyvalues.id and\n\t\tcharacterinfo.name = family.toname", $arg) or error_message("Query failed : " . mysql_error());
printf("<B>Family Relations:</B><BR><UL>");
while ($myrow = mysql_fetch_array($result)) {
if ($myrow[2] == null) {
printf("<LI>%s of %s<BR>", $myrow[0], $myrow[1]);
} else {
printf("<LI>%s of <A\nHREF=\"/scripts/charactersheet.php?name=%s\">%s</A><BR>", $myrow[0], $myrow[1], $myrow[1]);
}
}
printf("</UL>");
}
示例8: pageAccess
function pageAccess($roles, $allowed = array())
{
foreach ($allowed as $key => $val) {
if (in_array($val, $roles)) {
$access_allowed = 1;
}
}
if ($access_allowed != 1) {
$errors[] = "You do not have sufficient permissions to access this page";
echo error_message($errors);
exit;
}
}
示例9: get_data
public function get_data()
{
$ObjDb = new connect_db();
$ObjDb->db_connect();
$query = "SELECT site FROM {$this->site_tablename} WHERE user_id = '{$this->user_id}' GROUP BY site";
$result = mysql_query($query);
if (!$result) {
error_message(mysql_error());
}
for ($i = 0; $i < mysql_num_rows($result); $i++) {
$query_data = mysql_fetch_array($result);
$site = $query_data['site'];
//$SiteArray[] = iconv('windows-1251', 'utf-8', $site);
$SiteArray[] = $site;
}
if (count($SiteArray) != 0) {
$SiteArray = array_unique($SiteArray);
$temp = $SiteArray;
$SiteArray = array();
foreach ($temp as $value) {
$SiteArray[] = $value;
}
unset($temp);
}
//----------------------поиск сайтов с неуказаными запросами в таблице
if (count($SiteArray) != 0) {
foreach ($SiteArray as $site) {
//$site = iconv('utf-8', 'windows-1251', $site);
$query = "SELECT keyword FROM {$this->site_tablename} WHERE user_id = '{$this->user_id}' AND site = '{$site}'";
$result = mysql_query($query);
if (!$result) {
error_message(mysql_error());
}
for ($i = 0; $i < mysql_num_rows($result); $i++) {
$query_data = mysql_fetch_array($result);
$keyword = $query_data['keyword'];
if ($keyword == null) {
$keywordBool[] = 0;
break;
} else {
$keywordBool[] = 1;
$bool = 1;
break;
}
}
}
}
$data = array('sitearray' => $SiteArray, 'bool' => $bool, 'keywordbool' => $keywordBool, 'seacher' => $this->seacher);
$ObjDb->db_close();
return $data;
}
示例10: update
public function update($id, $cpm_quota)
{
try {
$data = array("cpm_quota" => $cpm_quota, "update_user" => $this->session->userdata("username"));
$this->db->where("id", $id);
$query = $this->db->update("tbl_cpm", $data);
if (!$query) {
throw new Exception();
}
return true;
} catch (Exception $e) {
$errNo = $this->db->_error_number();
//$errMsg = $this->db->_error_message();
return error_message($errNo);
}
}
示例11: show_list_biblio
function show_list_biblio()
{
global $dbh;
global $msg;
global $charset;
//Récupération de l'utilisateur
$requete_user = "SELECT userid FROM users where username='" . SESSlogin . "' limit 1 ";
$res_user = pmb_mysql_query($requete_user, $dbh);
$row_user = pmb_mysql_fetch_row($res_user);
$user_userid = $row_user[0];
//Affichage de la liste des etablissements auxquels a acces l'utilisateur
$aff = "<table>";
$q = entites::list_biblio($user_userid);
$res = pmb_mysql_query($q, $dbh);
$nbr = pmb_mysql_num_rows($res);
if (!$nbr) {
//Pas d'etablissements définis pour l'utilisateur
$error = true;
$error_msg .= htmlentities($msg["acquisition_err_coord"], ENT_QUOTES, $charset) . "<div class='row'></div>";
}
if ($error) {
error_message($msg[321], $error_msg . htmlentities($msg["acquisition_err_par"], ENT_QUOTES, $charset), '1', './admin.php?categ=acquisition');
die;
}
if ($nbr == '1') {
$row = pmb_mysql_fetch_object($res);
show_list_exer($row->id_entite);
} else {
$parity = 1;
while ($row = pmb_mysql_fetch_object($res)) {
if ($parity % 2) {
$pair_impair = "even";
} else {
$pair_impair = "odd";
}
$parity += 1;
$tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./admin.php?categ=acquisition&sub=compta&action=list&ent={$row->id_entite}';\" ";
$aff .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'><td><i>{$row->raison_sociale}</i></td></tr>";
}
$aff .= "</table>";
print $aff;
}
}
示例12: getAccess
public function getAccess($level_id)
{
try {
$this->db->select("a.access_data, b.menu, b.create, b.read, b.update, b.delete, b.progress");
$this->db->from("tbl_level a");
$this->db->join("tbl_level_access b", "a.id = b.level_id");
$this->db->where("a.id", $level_id);
$this->db->where("a.active_status", "Y");
$query = $this->db->get();
if (!$query) {
throw new Exception();
}
$result = $query->result();
return $result;
} catch (Exception $e) {
$errNo = $this->db->_error_number();
//$errMsg = $this->db->_error_message();
return error_message($errNo);
}
}
示例13: update
public function update($username, $password, $name, $email)
{
try {
if ($password == "false") {
$data = array("name" => $name, "email" => $email, "update_user" => $this->session->userdata("username"));
} else {
$data = array("password" => md5($password), "name" => $name, "email" => $email, "update_user" => $this->session->userdata("username"));
}
$this->db->where("username", $username);
$query = $this->db->update("tbl_user", $data);
if (!$query) {
throw new Exception();
}
return true;
} catch (Exception $e) {
$errNo = $this->db->_error_number();
//$errMsg = $this->db->_error_message();
return error_message($errNo);
}
}
示例14: Render
function Render()
{
global $Translation;
$eo['silentErrors'] = true;
$result = sql($this->Query . ' limit ' . datalist_auto_complete_size, $eo);
if ($eo['error'] != '') {
$this->HTML = error_message(htmlspecialchars($eo['error']) . "\n\n<!--\n{$Translation['query:']}\n {$this->Query}\n-->\n\n");
return;
}
$this->ItemCount = db_num_rows($result);
$combo = new Combo();
$combo->Class = $this->Class;
$combo->Style = $this->Style;
$combo->SelectName = $this->SelectName;
$combo->SelectedData = $this->SelectedData;
$combo->SelectedText = $this->SelectedText;
$combo->SelectedClass = 'SelectedOption';
$combo->ListType = $this->ListType;
$combo->ListBoxHeight = $this->ListBoxHeight;
$combo->RadiosPerLine = $this->RadiosPerLine;
$combo->AllowNull = $this->ListType == 2 ? 0 : $this->AllowNull;
while ($row = db_fetch_row($result)) {
$combo->ListData[] = htmlspecialchars($row[0], ENT_QUOTES, 'iso-8859-1');
$combo->ListItem[] = $row[1];
}
$combo->Render();
$this->MatchText = $combo->MatchText;
$this->SelectedText = $combo->SelectedText;
$this->SelectedData = $combo->SelectedData;
if ($this->ListType == 2) {
$rnd = rand(100, 999);
$SelectedID = htmlspecialchars(urlencode($this->SelectedData));
$pt_perm = getTablePermissions($this->parent_table);
if ($pt_perm['view'] || $pt_perm['edit']) {
$this->HTML = str_replace(">{$this->MatchText}</label>", ">{$this->MatchText}</label> <button type=\"button\" class=\"btn btn-default view_parent hspacer-lg\" id=\"{$this->parent_table}_view_parent\" title=" . htmlspecialchars($Translation['View']) . "><i class=\"glyphicon glyphicon-eye-open\"></i></button>", $combo->HTML);
}
$this->HTML = str_replace(' type="radio" ', ' type="radio" onclick="' . $this->SelectName . '_changed();" ', $this->HTML);
} else {
$this->HTML = $combo->HTML;
}
}
示例15: register
function register($username, $password, $confirm)
{
if (empty($username)) {
return error_message(E_REGISTER, E_NO_USERNAME);
}
if (empty($password)) {
return error_message(E_REGISTER, E_NO_PASSWORD);
}
if (empty($confirm)) {
return error_message(E_REGISTER, E_NO_CONFIRM);
}
if ($password !== $confirm) {
return error_message(E_REGISTER, 'Mismatch');
}
$user = look_up_key_value($username, USER_ACCOUNT_FILE);
if (!empty($user)) {
return error_message(E_REGISTER, E_ACCOUNT_EXISTS);
}
add_key_value($username, [$username, password_hash($password, PASSWORD_DEFAULT)], USER_ACCOUNT_FILE);
set_user($username);
return '';
}