<?php
/* $Id: lib.inc.php,v 1.131 2001/08/30 21:20:07 swix Exp $ */
if (!defined('__LIB_INC__')){
define('__LIB_INC__', 1);
/**
* Order of sections for lib.inc.php:
*
* in PHP3, functions and constants must be physically defined
* before they are referenced
*
* some functions need the constants of defines.inc.php
*
* the include of defines.inc.php must be after the connection to db to
* get the MySql version
*
* the auth() function must be before the connection to db
*
* the mysql_die() function must be before the connection to db but after
* mysql extension has been loaded
*
* ... so the required order is:
*
* - definition of auth()
* - parsing of the configuration file
* - first load of the define.lib.php library (won't get the MySQL
* release number)
* - load of mysql extension (if necessary)
* - definition of mysql_die()
* - db connection
* - second load of the define.lib.php library to get the MySQL release
* number)
* - other functions, respecting dependencies
*/
/**
* Avoids undefined variables in PHP3
*/
if (!isset($use_backquotes)) {
$use_backquotes = 0;
}
if (!isset($pos)) {
$pos = 0;
}
if (!isset($cfgProtectBlob)) {
$cfgProtectBlob = FALSE;
}
/**
* Advanced authentication work
* Requires Apache loaded as a php module.
*/
function auth()
{
header('status: 401 Unauthorized');
header('HTTP/1.0 401 Unauthorized');
header('WWW-authenticate: basic realm="phpMyAdmin on ' . $GLOBALS['cfgServer']['host'] . '"');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php echo $GLOBALS['strAccessDenied']; ?></title>
</head>
<body bgcolor="#FFFFFF">
<br /><br />
<center>
<h1><?php echo $GLOBALS['strWrongUser']; ?></h1>
</center>
</body>
</html>
<?php
echo "\n";
exit();
} // end of the 'auth()' function
/**
* Parses the configuration file and gets some constants used to define
* versions of phpMyAdmin/php/mysql...
*/
include('./config.inc.php');
// For compatibility with old config.inc.php
if (!isset($cfgTextareaCols)) {
$cfgTextareaCols = 40;
}
if (!isset($cfgTextareaRows)) {
$cfgTextareaRows = 7;
}
// Adds a trailing slash et the end of the phpMyAdmin uri if it does not
// exist
if ($cfgPmaAbsoluteUri != '' && substr($cfgPmaAbsoluteUri, -1) != '/') {
$cfgPmaAbsoluteUri .= '/';
}
include('./defines.inc.php');
/**
* Loads the mysql extensions if it is not loaded yet
* staybyte - 26. June 2001
*/
if (PHP_INT_VERSION >= 30009) {
if (PMA_WINDOWS) {
$suffix = '.dll';
} else {
$suffix = '.so';
}
if (PHP_INT_VERSION < 40000) {
$extension = 'MySQL';
} else {
$extension = 'mysql';
}
if (!@extension_loaded($extension) && !@get_cfg_var('safe_mode') && @function_exists('dl')) {
@dl($extension.$suffix);
}
if (!@extension_loaded($extension)) {
echo $strCantLoadMySQL;
exit();
}
} // end load mysql extension
/**
* Displays a MySQL error message in the right frame.
*
* @param string the error mesage
* @param string the sql query that failed
* @param boolean whether to show a "modify" link or not
* @param boolean whether to show a "back" link or not
*/
function mysql_die($error_message = '', $the_query = '',
$is_modify_link = TRUE, $is_back_link = TRUE)
{
if (!$error_message) {
$error_message = mysql_error();
}
if (!$the_query && !empty($GLOBALS['sql_query'])) {
$the_query = $GLOBALS['sql_query'];
}
echo '<b>'. $GLOBALS['strError'] . '</b>' . "\n";
// if the config password is wrong, or the MySQL server does not
// respond, do not show the query that would reveal the
// username/password
if (!empty($the_query) && !strstr($the_query, 'connect')) {
$query_base = htmlspecialchars($the_query);
$query_base = ereg_replace("((\015\012)|(\015)|(\012)){3,}", "\n\n", $query_base);
echo '<p>' . "\n";
echo ' ' . $GLOBALS['strSQLQuery'] . ' : ' . "\n";
if ($is_modify_link) {
echo ' ['
. '<a href="db_details.php?lang=' . $GLOBALS['lang'] . '&server=' . urlencode($GLOBALS['server']) . '&db=' . urlencode($GLOBALS['db']) . '&sql_query=' . urlencode($the_query) . '&show_query=y">' . $GLOBALS['strEdit'] . '</a>'
. ']' . "\n";
} // end if
echo '<pre>' . "\n" . $query_base . "\n" . '</pre>' . "\n";
echo '</p>' . "\n";
} // end if
if (!empty($error_message)) {
$error_message = htmlspecialchars($error_message);
$error_message = ereg_replace("((\015\012)|(\015)|(\012)){3,}", "\n\n", $error_message);
}
echo '<p>' . "\n";
echo ' ' . $GLOBALS['strMySQLSaid'] . '<br />' . "\n";
echo '<pre>' . "\n" . $error_message . "\n" . '</pre>' . "\n";
echo '</p>' . "\n";
if ($is_back_link) {
$hist = (isset($GLOBALS['btnDrop'])) ? -2 : -1;
echo '<a href="javascript:window.history.go(' . $hist . ')">' . $GLOBALS['strBack'] . '</a>';
}
echo "\n";
include('./footer.inc.php');
exit();
} // end of the 'mysql_die()' function
/**
* Use mysql_connect() or mysql_pconnect()?
*/
$connect_func = ($cfgPersistentConnections) ? 'mysql_pconnect' : 'mysql_connect';
$dblist = array();
/**
* Gets the valid servers list and parameters
*/
reset($cfgServers);
while (list($key, $val) = each($cfgServers)) {
// Don't use servers with no hostname
if (empty($val['host'])) {
unset($cfgServers[$key]);
}
}
if (empty($server) || !isset($cfgServers[$server]) || !is_array($cfgServers[$server])) {
$server = $cfgServerDefault;
}
/**
* If no server is selected, make sure that $cfgServer is empty (so that
* nothing will work), and skip server authentication.
* We do NOT exit here, but continue on without logging into any server.
* This way, the welcome page will still come up (with no server info) and
* present a choice of servers in the case that there are multiple servers
* and '$cfgServerDefault = 0' is set.
*/
if ($server == 0) {
$cfgServer = array();
}
/**
* Otherwise, set up $cfgServer and do the usual login stuff.
*/
else if (isset($cfgServers[$server])) {
$cfgServer = $cfgServers[$server];
// Check how the config says to connect to the server
$server_port = (empty($cfgServer['port']))
? ''
: ':' . $cfgServer['port'];
if (strtolower($cfgServer['connect_type']) == 'tcp') {
$cfgServer['socket'] = '';
}
$server_socket = (empty($cfgServer['socket']) || PHP_INT_VERSION < 30010)
? ''
: ':' . $cfgServer['socket'];
// The user can work with only some databases
if (isset($cfgServer['only_db']) && !empty($cfgServer['only_db'])) {
if (is_array($cfgServer['only_db'])) {
$dblist = $c
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
整站程序足球彩票网全站程序-zucai.zip (5230个子文件)
RELEASE-DATE-2.2.0 30B
fader.js.bak 8KB
ChangeLog 79KB
CREDITS 182B
global.css 4KB
global.css 4KB
global.css 4KB
global.css 4KB
global.css 4KB
global.css 4KB
global.css 4KB
global.css 4KB
global.css 4KB
global.css 4KB
global.css 4KB
global.css 4KB
MAIN.CSS 2KB
cp.css 2KB
style.css 145B
style.css 145B
datalist.dat 293B
datalist.dat 274B
datalist.dat 70B
jacky.dat 26B
jacky.dat 26B
jacky.dat 26B
userlist.dat 10B
userlist.dat 10B
userlist.dat 10B
datalast.dat 6B
datalast.dat 6B
datalast.dat 6B
dc123.dat 4B
dc33.dat 4B
dc51.dat 4B
dc11.dat 4B
dc53.dat 3B
dc121.dat 3B
dc31.dat 3B
dc62.dat 3B
dc21.dat 3B
dc82.dat 3B
dc52.dat 3B
dc43.dat 3B
dc81.dat 3B
dc91.dat 3B
dc41.dat 3B
dc102.dat 3B
dc23.dat 3B
dc132.dat 3B
dc122.dat 3B
dc111.dat 3B
dc63.dat 3B
dc93.dat 3B
dc12.dat 3B
dc72.dat 3B
dc133.dat 3B
dc32.dat 3B
dc22.dat 3B
dc112.dat 3B
dc61.dat 3B
dc101.dat 3B
dc42.dat 3B
dc103.dat 3B
dc92.dat 3B
dc113.dat 3B
dc71.dat 3B
dc131.dat 3B
dc73.dat 3B
dc83.dat 3B
dc13.dat 2B
datatotal.dat 1B
datatotal.dat 1B
datatotal.dat 1B
source.dwt 7KB
dangdang.dwt 641B
Entries 2KB
Entries 1KB
Entries 378B
Entries 150B
team.fla 16KB
huangjin.gif 60KB
zcww.gif 51KB
zcww.gif 51KB
banner.gif 34KB
banner.gif 34KB
tzdfro.gif 30KB
g2game.gif 20KB
ultimate_banner.gif 18KB
ultimate_banner.gif 18KB
JSBANNER.GIF 18KB
anim_ai.gif 15KB
anim_ai.gif 15KB
ORbanner01.gif 15KB
ORbanner01.gif 15KB
wzzc.gif 15KB
wzzc.gif 15KB
anim_ah.gif 14KB
anim_ah.gif 14KB
1asdvl.gif 14KB
共 5230 条
- 1
- 2
- 3
- 4
- 5
- 6
- 53
资源评论
scjrw
- 粉丝: 14
- 资源: 155
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功