<?php
// If this file is not included from the MMHTTPDB possible hacking problem.
if (!function_exists('create_error')){
die();
}
define('MYSQL_NOT_EXISTS', create_error("Your PHP server doesn't have the MySQL module loaded or you can't use the mysql_(p)connect functions."));
define('CONN_NOT_OPEN_GET_TABLES', create_error('The Connection could not be opened when trying to retrieve the tables.'));
define('CONN_NOT_OPEN_GET_DB_LIST', create_error('The Connection could not be opened when trying to retrieve the database list.'));
if (!function_exists('mysql_connect') || !function_exists('mysql_pconnect') || !extension_loaded('mysql')){
echo MYSQL_NOT_EXISTS;
die();
}
// Now let's handle the crashes or any other PHP errors that we can catch
function KT_ErrorHandler($errno, $errstr, $errfile, $errline) {
global $f, $already_sent;
$errortype = array (
1 => "Error",
2 => "Warning",
4 => "Parsing Error",
8 => "Notice",
16 => "Core Error",
32 => "Core Warning",
64 => "Compile Error",
128 => "Compile Warning",
256 => "User Error",
512 => "User Warning",
1024=> "User Notice",
2048=> "E_ALL",
2049=> "PHP5 E_STRICT"
);
$str = sprintf("[%s]\n%s:\t%s\nFile:\t\t'%s'\nLine:\t\t%s\n\n", date('d-m-Y H:i:s'),(isset($errortype[@$errno])?$errortype[@$errno]:('Unknown '.$errno)),@$errstr,@$errfile,@$errline);
if (error_reporting() != 0) {
@fwrite($f, $str);
if (@$errno == 2 && isset($already_sent) && !$already_sent==true){
$error = '<ERRORS>'."\n";
$error .= '<ERROR><DESCRIPTION>An Warning Type error appeared. The error is logged into the log file.</DESCRIPTION></ERROR>'."\n";
$error .= '</ERRORS>'."\n";
$already_sent = true;
echo $error;
}
}
}
if ($debug_to_file){
$old_error_handler = set_error_handler("KT_ErrorHandler");
}
class MySqlConnection
{
/*
// The 'var' keyword is deprecated in PHP5 ... we will define these variables at runtime.
var $isOpen;
var $hostname;
var $database;
var $username;
var $password;
var $timeout;
var $connectionId;
var $error;
*/
function MySqlConnection($ConnectionString, $Timeout, $Host, $DB, $UID, $Pwd)
{
$this->isOpen = false;
$this->timeout = $Timeout;
$this->error = '';
if( $Host ) {
$this->hostname = $Host;
}
elseif( preg_match("/host=([^;]+);/", $ConnectionString, $ret) ) {
$this->hostname = $ret[1];
}
if( $DB ) {
$this->database = $DB;
}
elseif( preg_match("/db=([^;]+);/", $ConnectionString, $ret) ) {
$this->database = $ret[1];
}
if( $UID ) {
$this->username = $UID;
}
elseif( preg_match("/uid=([^;]+);/", $ConnectionString, $ret) ) {
$this->username = $ret[1];
}
if( $Pwd ) {
$this->password = $Pwd;
}
elseif( preg_match("/pwd=([^;]+);/", $ConnectionString, $ret) ) {
$this->password = $ret[1];
}
}
function Open()
{
$this->connectionId = mysql_connect($this->hostname, $this->username, $this->password);
if (isset($this->connectionId) && $this->connectionId && is_resource($this->connectionId))
{
$this->isOpen = ($this->database == "") ? true : mysql_select_db($this->database, $this->connectionId);
}
else
{
$this->isOpen = false;
}
}
function TestOpen()
{
return ($this->isOpen) ? '<TEST status=true></TEST>' : $this->HandleException();
}
function Close()
{
if (is_resource($this->connectionId) && $this->isOpen)
{
if (mysql_close($this->connectionId))
{
$this->isOpen = false;
unset($this->connectionId);
}
}
}
function GetTables($table_name = '')
{
$xmlOutput = "";
if ($this->isOpen && isset($this->connectionId) && is_resource($this->connectionId)){
// 1. mysql_list_tables and mysql_tablename are deprecated in PHP5
// 2. For backward compatibility GetTables don't have any parameters
if ($table_name === ''){
$table_name = @$_POST['Database'];
}
//added backtick for handling reserved words and special characters
//http://dev.mysql.com/doc/refman/5.0/en/legal-names.html
$sql = ' SHOW TABLES FROM ' . $this->ensureTicks($table_name) ;
$results = mysql_query($sql, $this->connectionId) or $this->HandleException();
$xmlOutput = "<RESULTSET><FIELDS>";
// Columns are referenced by index, so Schema and
// Catalog must be specified even though they are not supported
$xmlOutput .= '<FIELD><NAME>TABLE_CATALOG</NAME></FIELD>'; // column 0 (zero-based)
$xmlOutput .= '<FIELD><NAME>TABLE_SCHEMA</NAME></FIELD>'; // column 1
$xmlOutput .= '<FIELD><NAME>TABLE_NAME</NAME></FIELD>'; // column 2
$xmlOutput .= "</FIELDS><ROWS>";
if (is_resource($results) && mysql_num_rows($results) > 0){
while ($row = mysql_fetch_array($results)){
$xmlOutput .= '<ROW><VALUE/><VALUE/><VALUE>' . $row[0]. '</VALUE></ROW>';
}
}
$xmlOutput .= "</ROWS></RESULTSET>";
}
return $xmlOutput;
}
function GetViews()
{
// not supported
return "<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>";
}
function GetProcedures()
{
// not supported
return "<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>";
}
function GetColumnsOfTable($TableName)
{
$xmlOutput = "";
//added backtick for handling reserved words and special characters
//http://dev.mysql.com/doc/refman/5.0/en/legal-names.html
$query = "DESCRIBE ".$this->ensureTicks($TableName);
$result = mysql_query($query) or $this->HandleException();
if ($result)
{
$xmlOutput = "<RESULTSET><FIELDS>";
// Columns are referenced by index, so Schema and
// Catalog must be specified even though they are not supported
$xmlOutput .= "<FIELD><NAME>TABLE_CATALOG</NAME></FIELD>"; // column 0 (zero-based)
$xmlOutput .= "<FIELD><NAME>TABLE_SCHEMA</NAME></FIELD>"; // column 1
$xmlOutput .= "<FIELD><NAME>TABLE_NAME</NAME></FIELD>"; // column 2
$xmlOutput .= "<FIELD><NAME>COLUMN_NAME</NAME></FIELD>";
$xmlOutput .= "<FIELD><NAME>DATA_TYPE</NAME></FIELD>";
$xmlOutput .= "<FIELD><NAME>IS_NULLABLE</NAME></FIELD>";
$xmlOutput .= "<FIELD><NAME>COLUMN_SIZE</NAME></FIELD>";
$xmlOutput .= "</FIELDS><ROWS>";
// The fields returned from DESCRIBE are: Field, Type, Null, Key, Default, Extra
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$xmlOutput .= "<ROW><VALUE/><VALUE/><VALUE/>";
// Separate type from size. Format is: type(size)
if (preg_match("/(.*)\((.*)\)/", $row["Type"], $ret))
{
$type = $ret[1];
$size = $ret[2];
}
else
{
$type = $row["Type"];
$size = "";
}
// MySQL sets nullable to "YES" or "", so we need to set "NO"
$null = $row["Null"];
if ($null == "")
$null = "NO";
$xmlOutput .= "<VALUE>" . $row["Field"] . "</VALUE>";
$xmlOutput .= "<VALUE>" . $type . "</VALUE>";
$xmlOutput .= "<VALUE>" . $null . "</VALUE>";
$xmlOutput .= "<VALUE>" . $size . "</VALUE></ROW>";
}
mysql_free_result($result);
$xmlOutput .= "</ROWS></RESULTSET>";
}
return $xmlOutput;
}
function GetParametersOfProcedure($ProcedureName, $SchemaName, $CatalogName)
{
// not supported on MySQL
return '<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>';
}
function ExecuteSQL($aStatement, $MaxRows)
{
if ( get_magic_quotes_gpc() )
{
$aStatement = stripslashes( $aStatement ) ;
}
$xmlOutput = "";
$result = mysql_query($aStatement) or $this->HandleException();
if (isset($result) && is_resource($result))
{
$xmlOutput = "<RESULTSET><FIELDS>";
$fieldCount = mysql_num_fields($result);
for ($i=0; $i < $fieldCount; $i++)
{
$meta = mysql_fetch_field($result);
if ($meta)
{
$xmlOutput .= '<FIELD';
$xmlOutput .= ' type="'
没有合适的资源?快使用搜索试试~ 我知道了~
音乐后台管理系统
共192个文件
gif:115个
mno:20个
jpg:18个
需积分: 50 79 下载量 24 浏览量
2014-06-21
21:51:13
上传
评论 2
收藏 10.01MB RAR 举报
温馨提示
一个简单的音乐后台管理系统,php代码+mysql,数据库要自己去创建,有些地方要自己修改
资源推荐
资源详情
资源评论
收起资源包目录
音乐后台管理系统 (192个子文件)
AddMp3.php.bak 7KB
admin.php.bak 831B
conn.php.bak 308B
fox.css 7KB
skin.css 4KB
login-content-bg.gif 20KB
login-wel.gif 9KB
logo.gif 7KB
menu_bg2.gif 4KB
servicezhgb2312.gif 3KB
buttom-right.gif 2KB
ershou_1.gif 2KB
ershou_2.gif 2KB
menu_bgs.gif 2KB
title.gif 2KB
sitebackup.gif 2KB
DefaultDocs.gif 2KB
menu_bg.gif 2KB
tool-down-pic.gif 2KB
buttom-left.gif 2KB
mime.gif 2KB
password.gif 2KB
ad.gif 2KB
lminfo.gif 2KB
defind.gif 2KB
ipsecurity.gif 2KB
user-info.gif 2KB
Redirects.gif 2KB
usercontrol.gif 2KB
menu_bg1.gif 1KB
lm.gif 1KB
Login_but.gif 1KB
pic19.gif 1KB
menu_topline.gif 1KB
pic5.gif 1KB
pic23.gif 1KB
pic18.gif 1KB
yc.gif 1018B
out.gif 859B
nav-right-bg.gif 735B
pic16.gif 651B
icon-demo.gif 648B
icon-login-seaver.gif 633B
icon-phone.gif 633B
imageedit.gif 625B
edit.gif 624B
pic17.gif 622B
report2_(delete).gif 621B
delete.gif 618B
image_(add)6.gif 617B
delete_6.gif 617B
report2_(add).gif 615B
imagedelete.gif 615B
format.gif 610B
image_1.gif 608B
add.gif 606B
pic13.gif 605B
stop.gif 604B
yx.gif 604B
buttom-copy-bg.gif 600B
str.gif 598B
ts.gif 597B
st.gif 594B
icon-mail2.gif 592B
pic14.gif 587B
pic22.gif 585B
pic9.gif 580B
pic8.gif 578B
vie.gif 578B
gw2.gif 570B
pic7.gif 563B
pic15.gif 561B
linkspic3.gif 558B
top-right.gif 556B
pic21.gif 552B
pic24.gif 551B
pic25.gif 535B
close.gif 502B
pic6.gif 440B
luck.gif 429B
set.gif 405B
left-top-right.gif 391B
buttom_right2.gif 383B
database_import_.gif 379B
pic11.gif 360B
gw.gif 354B
buttom_left2.gif 353B
check-out_.gif 350B
pic10.gif 350B
t2bg2.gif 334B
pic1.gif 330B
pic12.gif 309B
left-bg.gif 276B
content-bg.gif 257B
l1b5.gif 257B
!.gif 253B
buttom_bgs.gif 225B
linkspic6.gif 218B
t2bg5.gif 216B
set2.gif 215B
共 192 条
- 1
- 2
资源评论
chjchj1233
- 粉丝: 1
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功