本文整理汇总了PHP中show_error_msg函数的典型用法代码示例。如果您正苦于以下问题:PHP show_error_msg函数的具体用法?PHP show_error_msg怎么用?PHP show_error_msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了show_error_msg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadimage
function uploadimage($x, $imgname, $tid)
{
global $site_config;
$imagesdir = $site_config["torrent_dir"] . "/images";
$allowed_types =& $site_config["allowed_image_types"];
if (!($_FILES["image{$x}"]["name"] == "")) {
if ($imgname != "") {
$img = "{$imagesdir}/{$imgname}";
$del = unlink($img);
}
$y = $x + 1;
$im = getimagesize($_FILES["image{$x}"]["tmp_name"]);
if (!$im[2]) {
show_error_msg(T_("ERROR"), "Invalid Image {$y}.", 1);
}
if (!array_key_exists($im['mime'], $allowed_types)) {
show_error_msg(T_("ERROR"), T_("INVALID_FILETYPE_IMAGE"), 1);
}
if ($_FILES["image{$x}"]["size"] > $site_config['image_max_filesize']) {
show_error_msg(T_("ERROR"), sprintf(T_("INVAILD_FILE_SIZE_IMAGE"), $y), 1);
}
$uploaddir = "{$imagesdir}/";
$ifilename = $tid . $x . $allowed_types[$im['mime']];
$copy = copy($_FILES["image{$x}"]["tmp_name"], $uploaddir . $ifilename);
if (!$copy) {
show_error_msg(T_("ERROR"), sprintf(T_("ERROR_UPLOADING_IMAGE"), $y), 1);
}
return $ifilename;
}
}
示例2: __construct
private function __construct()
{
if (function_exists('bbcode_create')) {
$this->bbcode = bbcode_create($this->getTags());
$this->initSmilies();
return;
}
show_error_msg('Error', 'BBCode not available, you need to run `pecl install bbcode-1.0.3b1`', 1);
}
示例3: error_msg_exit
function error_msg_exit($msg)
{
echo <<<EOT
<html>
<head>
<title>Developer Tools</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
</head>
<body>
EOT;
show_error_msg($msg);
echo <<<EOT
</body>
</html>
EOT;
exit;
}
示例4: main
function main()
{
if (isset($_GET['day'])) {
$day = $_GET['day'];
} else {
$day = date('Y-m-d');
}
check_post_values();
create_html_start();
show_error_msg();
create_edit_form($day);
create_html_end();
}
示例5: dbconn
dbconn(true);
loggedinonly(true);
?>
<?php
if (!$CURUSER) {
?>
<meta http-equiv='refresh' content='0;url=account-login.php' />
<?php
}
stdhead(T_("HOME"));
//check
if (file_exists("check.php") && $CURUSER["class"] == 7) {
show_error_msg("WARNING", "Check.php still exists, please delete or rename the file as it could pose a security risk<br /><br /><a href='check.php'>View Check.php</a> - Use to check your config!<br /><br />", 0);
}
//Site Notice
if ($site_config['SITENOTICEON']) {
begin_frame(T_("NOTICE"));
echo $site_config['SITENOTICE'];
end_frame();
}
//Site News
if ($site_config['NEWSON'] && $CURUSER['view_news'] == "yes") {
begin_frame(T_("NEWS"));
$res = SQL_Query_exec("SELECT news.id, news.title, news.added, news.body, users.username FROM news LEFT JOIN users ON news.userid = users.id ORDER BY added DESC LIMIT 10");
if (mysql_num_rows($res) > 0) {
print "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>\n<ul>";
$news_flag = 0;
while ($array = mysql_fetch_assoc($res)) {
示例6: sqlesc
} else {
$subject = @$_POST['subject'];
$msg = sqlesc(@$_POST['msg']);
}
if ($msg) {
$subject = sqlesc($subject);
if ((isset($_POST['draft']) || isset($_POST['template'])) && isset($_POST['msgid'])) {
SQL_Query_exec("UPDATE messages SET `subject` = {$subject}, `msg` = {$msg} WHERE `id` = {$_POST['msgid']} AND `sender` = {$CURUSER['id']}") or die("arghh");
} else {
$to = @$_POST['draft'] ? 'draft' : (@$_POST['template'] ? 'template' : (@$_POST['save'] ? 'both' : 'in'));
$status = @$_POST['send'] ? 'yes' : 'no';
//===| Start Blocked Users
$blocked = SQL_Query_exec("SELECT id FROM blocked WHERE userid={$sendto} AND blockid={$CURUSER['id']}");
$show = mysql_num_rows($blocked);
if ($show != 0 && $CURUSER["control_panel"] != "yes") {
show_error_msg("Error", "[B]You're blocked by this member and you can not send messages to him![/B]\n", 1);
}
//===| End Blocked Users
SQL_Query_exec("INSERT INTO `messages` (`sender`, `receiver`, `added`, `subject`, `msg`, `unread`, `location`) VALUES ('{$CURUSER['id']}', '{$sendto}', '" . get_date_time() . "', {$subject}, {$msg}, '{$status}', '{$to}')") or die("Aargh!");
// email notif
$res = SQL_Query_exec("SELECT id, acceptpms, notifs, email FROM users WHERE id='{$sendto}'");
$user = mysql_fetch_assoc($res);
if (strpos($user['notifs'], '[pm]') !== false) {
$cusername = $CURUSER["username"];
$body = "You have received a PM from " . $cusername . "\n\nYou can use the URL below to view the message (you may have to login).\n\n " . $site_config['SITEURL'] . "/mailbox.php\n\n" . $site_config['SITENAME'] . "";
sendmail($user["email"], "You have received a PM from {$cusername}", $body, "From: {$site_config['SITEEMAIL']}", "-f{$site_config['SITEEMAIL']}");
}
//end email notif
if (isset($_POST['msgid'])) {
SQL_Query_exec("DELETE FROM messages WHERE `location` = 'draft' AND `sender` = {$CURUSER['id']} AND `id` = {$_POST['msgid']}") or die("arghh");
}
示例7: init
<html lang="ja">
<head>
<title>開発用サービス</title>
<meta http-equiv="content-type" content="text/html; charset=euc-jp">
<meta http-equiv="CONTENT-STYLE-TYPE" content="text/css">
<link rel="stylesheet" type="text/css" href="inc/style.css">
<script language="JavaScript" type="text/javascript"><!--
function init() {
document.LoginForm.pwd.focus();
}
//--> </script>
</head>
<body onLoad="init()">
<div id="contents">
<?php
echo show_error_msg($errors);
?>
<center>
<span class="Font2">開発用サービス</span><br /><br />
<form method="post" action="login.php" name="LoginForm" autocomplete="off">
<table border="0">
<tr>
<td nowrap><b>名前</b></td>
<td>
<?php
if ($users != false) {
?>
<select name='aid'>
<option value="">(あなたのお名前)</option>
<?php
foreach ($users as $user) {
示例8: dbconn
<?php
//
// TorrentTrader v2.x
// $LastChangedDate: 2012-09-28 20:35:06 +0100 (Fri, 28 Sep 2012) $
// $LastChangedBy: torrenttrader $
//
// http://www.torrenttrader.org
//
require_once "backend/functions.php";
dbconn();
$id = (int) $_GET["id"];
$md5 = $_GET["secret"];
$email = $_GET["email"];
if (!$id || !$md5 || !$email) {
show_error_msg(T_("ERROR"), T_("MISSING_FORM_DATA"), 1);
}
$res = SQL_Query_exec("SELECT `editsecret` FROM `users` WHERE `enabled` = 'yes' AND `status` = 'confirmed' AND `editsecret` != '' AND `id` = '{$id}'");
$row = mysql_fetch_assoc($res);
if (!$row) {
show_error_msg(T_("ERROR"), T_("NOTHING_FOUND"), 1);
}
$sec = $row["editsecret"];
if ($md5 != md5($sec . $email . $sec)) {
show_error_msg(T_("ERROR"), T_("NOTHING_FOUND"), 1);
}
SQL_Query_exec("UPDATE `users` SET `editsecret` = '', `email` = " . sqlesc($email) . " WHERE `id` = '{$id}' AND `editsecret` = " . sqlesc($row["editsecret"]));
header("Refresh: 0; url=account.php");
header("Location: account.php");
示例9: mysql_query
function &execute()
{
$query = $this->read();
$res = mysql_query($query);
if ($res || mysql_errno() == 1062) {
return $res;
}
$mysql_error = mysql_error();
$mysql_errno = mysql_errno();
// If debug_backtrace() is available, we can find exactly where the query was called from
if (function_exists("debug_backtrace")) {
$bt = debug_backtrace();
$i = 1;
if ($bt[$i]["function"] == "SQL_Query_exec_cached" || $bt[$i]["function"] == "get_row_count_cached" || $bt[$i]["function"] == "get_row_count") {
$i++;
}
$line = $bt[$i]["line"];
$file = str_replace(getcwd() . DIRECTORY_SEPARATOR, "", $bt[$i]["file"]);
$msg = "Database Error in {$file} on line {$line}: {$mysql_error}. Query was: {$query}.";
} else {
$file = str_replace(getcwd() . DIRECTORY_SEPARATOR, "", $_SERVER["SCRIPT_FILENAME"]);
$msg = "Database Error in {$file}: {$mysql_error}. Query was: {$query}";
}
mysql_query("INSERT INTO `sqlerr` (`txt`, `time`) \n VALUES (" . sqlesc($msg) . ", '" . get_date_time() . "')");
if (function_exists('show_error_msg')) {
show_error_msg("Database Error", "Database Error. Please report this to an administrator.", 1);
}
}
示例10: elseif
if ($upd["enabled"] == 0 && $upd["position"] == "left" && $_POST["enable_" . $upd["id"]] == 1) {
$update[] = "sort = " . $nextleft;
} elseif ($upd["enabled"] == 0 && $upd["position"] == "middle" && $_POST["enable_" . $upd["id"]] == 1) {
$update[] = "sort = " . $nextmiddle;
} elseif ($upd["enabled"] == 0 && $upd["position"] == "right" && $_POST["enable_" . $upd["id"]] == 1) {
$update[] = "sort = " . $nextright;
} elseif ($upd["enabled"] == 1 && $upd["position"] == "left" && $_POST["enable_" . $upd["id"]] == 0) {
$update[] = "sort = 0";
} elseif ($upd["enabled"] == 1 && $upd["position"] == "middle" && $_POST["enable_" . $upd["id"]] == 0) {
$update[] = "sort = 0";
} elseif ($upd["enabled"] == 1 && $upd["position"] == "right" && $_POST["enable_" . $upd["id"]] == 0) {
$update[] = "sort = 0";
} else {
$update[] = "sort = " . $upd["sort"];
}
SQL_Query_exec("UPDATE blocks SET " . implode(", ", $update) . " WHERE id={$id}") or show_error_msg(T_("ERROR"), "" . T_("_FAIL_DB_QUERY_") . ": " . mysql_error());
}
}
resortleft();
resortmiddle();
resortright();
}
// == end edit
echo "<center><a href=\"index.php\">" . T_("HOME") . "</a> • <a href=\"admincp.php\">" . T_("ADMIN_CP") . "</a> • <a href=\"admincp.php?action=blocks&do=view\">" . T_("_BLC_MAN_") . "</a></center>";
// ---- <table> for blocks in database -----------------------------------------
print "<hr />";
$res = SQL_Query_exec("SELECT * FROM blocks ORDER BY enabled DESC, position, sort");
print "<table align=\"center\"><tr><td>" . "<form name=\"blocks\" method=\"post\" action=\"blocks-edit.php\">" . "<input type=\"hidden\" name=\"edit\" value=\"true\" />" . "<table align=\"center\" class=\"table_table\" cellspacing=\"0\" width=\"650\">" . "<tr>" . "<td class=\"table_head\" align=\"center\"><font size=\"2\"><b>" . T_("_BLC_MAN_") . "</b></font></td>" . "</tr>" . "</table><br />" . "<table cellspacing=\"0\" class=\"table_table\" align=\"center\" width=\"650\">" . "<tr>" . "<th rowspan=\"2\" class=\"table_head\">" . T_("_NAMED_") . "<br />(" . T_("_FL_NM_IF_NO_SET_") . ")</th>" . "<th rowspan=\"2\" class=\"table_head\">" . T_("_FILE_NAME_") . "</th>" . "<th rowspan=\"2\" class=\"table_head\">" . T_("DESCRIPTION") . "<br />(" . T_("_MAX_") . " 255 " . T_("_CHARS_") . ")</th>" . "<th rowspan=\"2\" colspan=\"3\" class=\"table_head\">" . T_("_POSITION_") . "</th>" . "<th rowspan=\"2\" colspan=\"2\" class=\"table_head\">" . T_("_SORT_ORDER_") . "</th>" . "<th colspan=\"2\" class=\"table_head\">" . T_("ENABLED") . "</th>" . "<th rowspan=\"2\" class=\"table_head\">" . T_("_DEL_") . "</th>" . "</tr>" . "<tr>" . "<th class=\"table_head\">" . T_("YES") . "</th>" . "<th class=\"table_head\">" . T_("NO") . "</th>" . "</tr>";
while ($blocks2 = mysql_fetch_assoc($res)) {
$down = $blocks["id"];
if (!$setclass) {
示例11: htmlentities
$sure = htmlentities($_GET['sure']);
$type = htmlentities($_GET['type']);
if (!is_valid_id($targetid)) {
show_error_msg("Error", "Invalid ID {$userid}.", 1);
}
if (!$sure) {
show_error_msg("Delete {$type}", "<div style='margin-top:10px; margin-bottom:10px' align='center'>Do you really want to delete this {$typ}? \n" . "<a href=?id={$userid}&action=delete&type={$type}&targetid={$targetid}&sure=1>Yes</a> | <a href=/watch/>No</a></div>", 1);
}
if ($type == 'bookmarkuser') {
SQL_Query_exec("DELETE FROM bookmarkuser WHERE userid={$userid} AND bkid={$targetid}");
if (mysql_affected_rows() == 0) {
show_error_msg("Error", "No bookmarkuser found with ID {$targetid}", 1);
}
$frag = "bookmarkuser";
} else {
show_error_msg("Error", "Unknown type {$type}", 1);
}
header("Location: " . $site_config['SITEURL'] . "/watch/?id={$userid}#{$frag}");
die;
}
//===| Main Body |================================================================//
stdhead("Personal lists for " . $user['username']);
begin_frame("Personal lists for " . class_user($user[username]) . "");
print "<div style='margin-top:10px; margin-bottom:20px' align='center'><font size=2><font color=#0080FF><b>List of Personal watched users</b></font></div>";
?>
<table class="table_table" border="0" width="100%">
<tr>
<th class="table_head"><b>User Name</b></td></th>
<th class="table_head"><b>Account enabled?</b></td></th>
<th class="table_head"><b>Contact user</td></th>
<th class="table_head"><b>Last Seen</b></td></th>
示例12: strip_tags
$leechers = strip_tags($stats['peers']);
$downloaded = strip_tags($stats['downloaded']);
SQL_Query_exec("UPDATE torrents SET leechers='" . $leechers . "', seeders='" . $seeders . "',times_completed='" . $downloaded . "',last_action= '" . get_date_time() . "',visible='yes' WHERE id='" . $id . "'");
}
//END SCRAPE
write_log("Torrent {$id} ({$name}) was Uploaded by {$CURUSER['username']}");
$message .= "<br /><b>" . T_("UPLOAD_OK") . "</b><br /><a href='torrents-details.php?id=" . $id . "'>" . T_("UPLOAD_VIEW_DL") . "</a><br /><br />";
echo $message;
@unlink("{$dir}/{$fname}");
}
echo "</center>";
end_frame();
stdfoot();
die;
} else {
show_error_msg(T_("UPLOAD_FAILED"), $message, 1);
}
}
//takeupload
///////////////////// FORMAT PAGE ////////////////////////
stdhead(T_("UPLOAD"));
begin_frame(T_("UPLOAD"));
?>
<form name="upload" enctype="multipart/form-data" action="torrents-import.php" method="post">
<input type="hidden" name="takeupload" value="yes" />
<table border="0" cellspacing="0" cellpadding="6" align="center">
<tr><td align="right" valign="top"><b>File List:</b></td><td align="left"><?php
if (!count($files)) {
echo T_("NOTHING_TO_SHOW_FILES") . " {$dir}/.";
} else {
foreach ($files as $f) {
示例13: mksecret
if ($arr) {
$sec = mksecret();
$secmd5 = md5($sec);
$id = $arr['id'];
$body = T_("SOMEONE_FROM") . " " . $_SERVER["REMOTE_ADDR"] . " " . T_("MAILED_BACK") . " ({$email}) " . T_("BE_MAILED_BACK") . " \r\n\r\n " . T_("ACCOUNT_INFO") . " \r\n\r\n " . T_("USERNAME") . ": " . $arr["username"] . " \r\n " . T_("CHANGE_PSW") . "\n\n{$site_config['SITEURL']}/account-recover.php?id={$id}&secret={$secmd5}\n\n\n" . $site_config["SITENAME"] . "\r\n";
@sendmail($arr["email"], T_("ACCOUNT_DETAILS"), $body, "", "-f" . $site_config['SITEEMAIL']);
$res2 = SQL_Query_exec("UPDATE `users` SET `secret` = " . sqlesc($sec) . " WHERE `email`= " . sqlesc($email) . " LIMIT 1");
$msg = sprintf(T_('MAIL_RECOVER'), htmlspecialchars($email));
$kind = T_("SUCCESS");
}
}
}
stdhead();
begin_frame(T_("RECOVER_ACCOUNT"));
if ($kind != "0") {
show_error_msg("Notice", "{$kind}: {$msg}", 0);
}
if (is_valid_id($_GET["id"]) && strlen($_GET["secret"]) == 32) {
?>
<form method="post" action="account-recover.php">
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td>
<b><?php
echo T_("NEW_PASSWORD");
?>
</b>:
</td>
<td>
<input type="hidden" name="secret" value="<?php
echo $_GET['secret'];
示例14: showerror
if (!is_valid_id($topicid)) {
showerror(T_("FORUM_ERROR"), "Topic Not Valid");
}
$userid = $CURUSER["id"];
//------ Get topic info
$res = SQL_Query_exec("SELECT * FROM forum_topics WHERE id={$topicid}");
$arr = mysql_fetch_assoc($res) or showerror(T_("FORUM_ERROR"), "Topic not found");
$locked = $arr["locked"] == 'yes';
$subject = stripslashes($arr["subject"]);
$sticky = $arr["sticky"] == "yes";
$forumid = $arr["forumid"];
// Check if user has access to this forum
$res2 = SQL_Query_exec("SELECT minclassread, guest_read FROM forum_forums WHERE id={$forumid}");
$arr2 = mysql_fetch_assoc($res2);
if (!$arr2 || get_user_class() < $arr2["minclassread"] && $arr2["guest_read"] == "no") {
show_error_msg("Error: Access Denied", "You do not have access to the forum this topic is in.");
}
// Update Topic Views
$viewsq = SQL_Query_exec("SELECT views FROM forum_topics WHERE id={$topicid}");
$viewsa = mysql_fetch_array($viewsq);
$views = $viewsa[0];
$new_views = $views + 1;
$uviews = SQL_Query_exec("UPDATE forum_topics SET views = {$new_views} WHERE id={$topicid}");
// End
//------ Get forum
$res = SQL_Query_exec("SELECT * FROM forum_forums WHERE id={$forumid}");
$arr = mysql_fetch_assoc($res) or showerror(T_("FORUM_ERROR"), "Forum is empty");
$forum = stripslashes($arr["name"]);
//------ Get post count
$res = SQL_Query_exec("SELECT COUNT(*) FROM forum_posts WHERE topicid={$topicid}");
$arr = mysql_fetch_row($res);
示例15: dbconn
<?php
#================================#
# TorrentTrader 2.08 #
# http://www.torrenttrader.org #
#--------------------------------#
# Modified by BigMax #
#================================#
require_once "backend/functions.php";
dbconn();
loggedinonly();
$gottorrent = (int) $_GET["torrent"];
if (!isset($gottorrent)) {
show_error_msg("Error", " ... No torrent selected", 1);
}
if (get_row_count("bookmarks", "WHERE userid={$CURUSER['id']} AND torrentid = {$gottorrent}") > 0) {
show_error_msg("Error", "Already bookmarked torrent", 1);
}
if (get_row_count("torrents", "WHERE id = {$gottorrent}") > 0) {
SQL_Query_exec("INSERT INTO bookmarks (userid, torrentid) VALUES ({$CURUSER['id']}, {$gottorrent})");
stdhead("Bookmarks");
begin_frame("Successfully");
echo "<div style='margin-top:10px; margin-bottom:10px' align='center'>\n\t\t\tTorrent was successfully bookmarked. \n\t\t\t[<a href=torrents-details.php?id={$gottorrent}><b>Go to Torrent</b></a>] or\n\t\t\t[<a href=bookmark.php><b>See Your Bookmarks</b></a>]\n\t\t</div>";
end_frame();
stdfoot();
} else {
show_error_msg("Error", "ID not found", 1);
}