当前位置 : 主页 > 网络编程 > PHP >

wemall开源版微商城代码片段--更新安装出错

来源:互联网 收集:自由互联 发布时间:2021-06-30
WEMALL官方网站:www.wemallshop.com 1. [代码] [PHP]代码 WEMALL官方网站:www.wemallshop.com 2. [代码] config-template.php ?phpheader('Content-Type:text/html; charset=utf-8');error_reporting(E_ALL ~E_NOTICE);define('DB_HOST', 'db_h
WEMALL官方网站:www.wemallshop.com

1. [代码][PHP]代码    

WEMALL官方网站:www.wemallshop.com

2. [代码]config-template.php    

<?php
	header('Content-Type:text/html; charset=utf-8');
	error_reporting(E_ALL & ~E_NOTICE);
	
	define('DB_HOST', 'db_host');
	define('DB_PORT', 'db_port');
	define('DB_USER', 'db_user');
	define('DB_PWD', 'db_pwd');
	define('DB_NAME', 'db_name');
	define('DB_PREFIX', 'db_prefix');
	
	$conn = @mysql_connect(DB_HOST.":".DB_PORT, DB_USER, DB_PWD) or die('数据库链接失败:'.mysql_error());
	
	@mysql_select_db(DB_NAME) or die('数据库错误:'.mysql_error());
	
	@mysql_query('SET NAMES UTF8') or die('字符集错误:'.mysql_error());
?>

3. [代码]footer.php    

<div class="footer">  2013 - 2014 <a href="http://www.inuoer.com" target="_blank">WeMall微信商城管理系统</a>  </div>

4. [代码]header.php    

<div class="header">
    <h1 class="logo">WeMall微信商城管理系统</h1>
    <div class="icon_install">安装向导</div>
    <div class="version">QQ群:115303179</div>  </div>

5. [代码]lock.php    

<!doctype html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>WeMall微信商城管理系统</title>
        <link rel="stylesheet" href="./css/install.css?v=9.0" />
    </head>
    <body>
        <div class="wrap">
            <?php require './templates/header.php'; ?>
            <section class="section">
                <div class="">
                    <div class="success_tip error_tip"> <a href="javascript:void(0);" class="f16 b">已经安装过了,请不要重复安装!</a>
                   </div>
                    <div class=""> </div>
                </div>
            </section>
        </div>
        <?php require './templates/footer.php'; ?>
    </body>
</html>

6. [代码]s1.php    

<!doctype html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>WeMall微信商城管理系统</title>
        <link rel="stylesheet" href="./css/install.css?v=9.0" />
    </head>
    <body>
        <div class="wrap">
            <?php require './templates/header.php'; ?>
            <div class="section">
                <div class="main cc">
                    <pre class="pact" readonly="readonly">
				   WeMall管理系统使用协议

                    <b>本系统包含以下功能:</b>

                    1、快速创建微信商城;
                       一杯茶的时间创建您的微信商城。

                    2、丰富的界面;
                       简洁美观的界面,美轮美奂。  
                       
                    3、功能强大的系统;
                       商品,订单,微信等11种功能,全面覆盖。

                    4、多种屏幕预览;
                       支持多种型号手机,平板的预览,保障用户体验。

                    5、全网告诉访问;
                       借助公司的CDN骨干网,全网高速访问您的微信商城,畅享飞速体验。
                    </pre>
                </div>
                <div class="bottom tac"> <a href="./index.php?step=2" class="btn">接 受</a> </div>
            </div>
        </div>
        <?php require './templates/footer.php'; ?>
    </body>
</html>

7. [代码]s2.php    

<!doctype html>
<html>
<head>
  <meta charset="UTF-8" />
  <title>WeMall微信商城管理系统</title>
  <link rel="stylesheet" href="./css/install.css?v=9.0" />
</head>
<body>
  <div class="wrap">
    <?php require './templates/header.php';?>
    <section class="section">
      <div class="step">
        <ul>
          <li class="current"><em>1</em>检测环境</li>
          <li><em>2</em>创建数据</li>
          <li><em>3</em>完成安装</li>
        </ul>
      </div>
      <div class="server">
        <table width="100%">
          <tr>
            <td class="td1">环境检测</td>
            <td class="td1" width="25%">推荐配置</td>
            <td class="td1" width="25%">当前状态</td>
            <td class="td1" width="25%">最低要求</td>
          </tr>
          <tr>
            <td>操作系统</td>
            <td>类UNIX</td>
            <td><span class="correct_span">&radic;</span> <?php echo $os; ?></td>
            <td>不限制</td>
          </tr>
          <tr>
            <td>PHP版本</td>
            <td>>5.3.x</td>
            <td><span class="correct_span">&radic;</span> <?php echo $phpv; ?></td>
            <td>5.2.0</td>
          </tr>
          <tr>
            <td>Mysql版本(client)</td>
            <td>>5.x.x</td>
            <td><?php echo $mysql; ?></td>
            <td>4.2</td>
          </tr>
          <tr>
            <td>附件上传</td>
            <td>>2M</td>
            <td><?php echo $uploadSize; ?></td>
            <td>不限制</td>
          </tr>
          <tr>
            <td>session</td>
            <td>开启</td>
            <td><?php echo $session; ?></td>
            <td>开启</td>
          </tr>
          <tr>
            <td>GD库</td>
            <td>开启</td>
            <td><?php echo $gd; ?></td>
            <td>开启</td>
          </tr>
        </table>
        <table width="100%">
          <tr>
            <td class="td1">目录、文件权限检查</td>
            <td class="td1" width="25%">写入</td>
            <td class="td1" width="25%">读取</td>
          </tr>
          <?php
          foreach($folder as $dir){
           $Testdir = SITEDIR.$dir;
           dir_create($Testdir);
           if(TestWrite($Testdir)){
            $w = '<span class="correct_span">&radic;</span>可写 ';
          }else{
            $w = '<span class="correct_span error_span">&radic;</span>不可写 ';
            $err++;
          }
          if(is_readable($Testdir)){
            $r = '<span class="correct_span">&radic;</span>可读' ;
          }else{
            $r = '<span class="correct_span error_span">&radic;</span>不可读';
            $err++;
          }
          ?>
          <tr>
            <td><?php echo $dir; ?></td>
            <td><?php echo $w; ?></td>
            <td><?php echo $r; ?></td>
          </tr>
          <?php
        }
        ?>   
      </table>
    </div>
    <div class="bottom tac"> <a href="./index.php?step=2" class="btn">重新检测</a><a href="./index.php?step=3" class="btn">下一步</a> </div>
  </section>
</div>
<?php require './templates/footer.php';?>
</body>
</html>

8. [代码]s3.php    

<!doctype html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>WeMall微信商城管理系统</title>
        <link rel="stylesheet" href="./css/install.css?v=9.0" />
    </head>
    <body>
        <div class="wrap">
            <?php require './templates/header.php'; ?>
            <section class="section">
                <div class="step">
                    <ul>
                        <li class="on"><em>1</em>检测环境</li>
                        <li class="current"><em>2</em>创建数据</li>
                        <li><em>3</em>完成安装</li>
                    </ul>
                </div>
                <form id="J_install_form" action="index.php?step=4&install=1" method="post">
                    <input type="hidden" name="force" value="0" />
                    <div class="server">
                        <table width="100%">
                            <tr>
                                <td class="td1" width="100">数据库信息</td>
                                <td class="td1" width="200">&nbsp;</td>
                                <td class="td1">&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="tar">数据库服务器:</td>
                                <td><input type="text" name="dbhost" id="dbhost" value="localhost" class="input"></td>
                                <td><div id="J_install_tip_dbhost"><span class="gray">数据库服务器地址,一般为localhost</span></div></td>
                            </tr>
                            <tr>
                                <td class="tar">数据库端口:</td>
                                <td><input type="text" name="dbport" id="dbport" value="3306" class="input"></td>
                                <td><div id="J_install_tip_dbport"><span class="gray">数据库服务器端口,一般为3306</span></div></td>
                            </tr>
                            <tr>
                                <td class="tar">数据库用户名:</td>
                                <td><input type="text" name="dbuser" id="dbuser" value="" class="input"></td>
                                <td><div id="J_install_tip_dbuser"></div></td>
                            </tr>
                            <tr>
                                <td class="tar">数据库密码:</td>
                                <td><input type="text" name="dbpw" id="dbpw" value="" class="input" autoComplete="off" onBlur="TestDbPwd()"></td>
                                <td><div id="J_install_tip_dbpw"></div></td>
                            </tr>
                            <tr>
                                <td class="tar">数据库名:</td>
                                <td><input type="text" name="dbname" id="dbname" value="" class="input"></td>
                                <td><div id="J_install_tip_dbname"></div></td>
                            </tr>
                            <tr>
                                <td class="tar">表前缀:</td>
                                <td><input type="text" name="dbprefix" id="dbprefix" value="wemall_" class="input"></td>
                                <td><div id="J_install_tip_dbprefix"><span class="gray"></span></div></td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr>
                                <td class="td1" width="100"></td>
                                <td class="td1" width="200">&nbsp;</td>
                                <td class="td1">&nbsp;</td>
                            </tr>
                     
                            <tr>
                                <td class="tar"></td>
                                <td><input type="hidden" name="siteurl" value="http://<?php echo $domain ?>/" id="siteurl" class="input" autoComplete="off"></td>
                                <td><div id="J_install_tip_siteurl"><span class="gray"></span></div></td>
                            </tr>
                          
                        </table>
                        <table width="100%">
                            <tr>
                                <td class="td1" width="100">创始人信息</td>
                                <td class="td1" width="200">&nbsp;</td>
                                <td class="td1">&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="tar">管理员帐号:</td>
                                <td><input type="text" name="manager_email" class="input" value=""></td>
                                <td><div id="J_install_tip_manager_email"></div></td>
                            </tr>
                            <tr>
                                <td class="tar">密码:</td>
                                <td><input type="password" name="manager_pwd" id="J_manager_pwd" class="input" autoComplete="off"></td>
                                <td><div id="J_install_tip_manager_pwd"></div></td>
                            </tr>
                            <tr>
                                <td class="tar">重复密码:</td>
                                <td><input type="password" name="manager_ckpwd" class="input" autoComplete="off"></td>
                                <td><div id="J_install_tip_manager_ckpwd"></div></td>
                            </tr>
                        </table>
                        <input type="hidden" name="webPath" value="<?php echo $rootpath?>/" />
                        <div id="J_response_tips" style="display:none;"></div>
                    </div>
                    <div class="bottom tac"> <a href="./index.php?step=2" class="btn">上一步</a>
                        <button type="submit" class="btn btn_submit J_install_btn">创建数据</button>
                    </div>
                </form>
            </section>
            <div  style="width:0;height:0;overflow:hidden;"> <img src="./images/pop_loading.gif"> </div>
            <script src="./js/jquery.js?v=9.0"></script>
            <script src="./js/validate.js?v=9.0"></script>
            <script src="./js/ajaxForm.js?v=9.0"></script>
            <script>
                function TestDbPwd()
                {
                    var dbHost = $('#dbhost').val();
                    var dbUser = $('#dbuser').val();
                    var dbPwd = $('#dbpw').val();
                    var dbName = $('#dbname').val();
                    var dbPort = $('#dbport').val();
                    data={'dbHost':dbHost,'dbUser':dbUser,'dbPwd':dbPwd,'dbName':dbName,'dbPort':dbPort};
                    var url =  "./index.php?step=3&testdbpwd=1";
                    $.ajax({
                        type: "POST",
                        url: url,
                        data: data,
                        beforeSend:function(){
                        },
                        success: function(msg){
                            if(msg){
                            }else{
                                $('#dbpw').val("");
                                $('#J_install_tip_dbpw').html('<span for="dbname" generated="true" class="tips_error" style="">数据库链接配置失败</span>');
                            }
                        },
                        complete:function(){
                        },
                        error:function(){
                            $('#J_install_tip_dbpw').html('<span for="dbname" generated="true" class="tips_error" style="">数据库链接配置失败</span>');
                            $('#dbpw').val("");
                        }
                    });
                }
                $(function(){
                    //聚焦时默认提示
                    var focus_tips = {
                        dbhost : '数据库服务器地址,一般为localhost',
                        dbport : '数据库服务器端口,一般为3306',
                        dbuser : '',
                        dbpw : '',
                        dbname : '',
                        dbprefix : '建议使用默认,同一数据库安装多个时需修改',
                        manager_email : '创始人帐号,拥有站点后台所有管理权限',
                        manager_pwd : '',
                        manager_ckpwd : '',
                       
                    };
                    var install_form = $("#J_install_form"),
                    reg_username = $('#J_reg_username'),						//用户名表单
                    reg_password = $('#J_reg_password'),						//密码表单
                    reg_tip_password = $('#J_reg_tip_password'),		//密码提示区
                    response_tips = $('#J_response_tips');				//后端返回提示
                    //validate插件修改了remote ajax验证返回的response处理方式;增加密码强度提示 passwordRank
                    install_form.validate({
                        //debug : true,
                        //onsubmit : false,
                        errorPlacement: function(error, element) {
                            //错误提示容器
                            $('#J_install_tip_'+ element[0].name).html(error);
                        },
                        errorElement: 'span',
                        //invalidHandler : , 未验证通过 回调
                        //ignore : '.ignore' 忽略验证
                        //onkeyup : true,
                        errorClass : 'tips_error',
                        validClass		: 'tips_error',
                        onkeyup : false,
                        focusInvalid : false,
                        rules: {
                            dbhost: {
                                required	: true
                            },
                            dbport:{
                                required	: true
                            },
                            dbuser: {
                                required	: true
                            },
                            /*dbpw: {
                                required	: true
                            },*/
                            dbname: {
                                required	: true
                            },
                            dbprefix : {
                                required	: true
                            },
                            manager_email: {
                                required	: true
                            },
                            manager_pwd: {
                                required	: true
                            },
                            manager_ckpwd: {
                                required	: true,
                                equalTo : '#J_manager_pwd'
                            }
                        },
                        highlight	: false,
                        unhighlight	: function(element, errorClass, validClass) {
                            var tip_elem = $('#J_install_tip_'+ element.name);
                            tip_elem.html('<span class="'+ validClass +'" data-text="text"><span>');
                        },
                        onfocusin	: function(element){
                            var name = element.name;
                            $('#J_install_tip_'+ name).html('<span data-text="text">'+ focus_tips[name] +'</span>');
                            $(element).parents('tr').addClass('current');
                        },
                        onfocusout	:  function(element){
                            var _this = this;
                            $(element).parents('tr').removeClass('current');
                            if(element.name === 'email') {
                                //邮箱匹配点击后,延时处理
                                setTimeout(function(){
                                    _this.element(element);
                                }, 150);
                            }else{
                                _this.element(element);
                            }
                        },
                        messages: {
                            dbhost: {
                                required	: '数据库服务器地址不能为空'
                            },
                            dbport:{
                                required	: '数据库服务器端口不能为空'
                            },
                            dbuser: {
                                required	: '数据库用户名不能为空'
                            },
                            dbpw: {
                                required	: '数据库密码不能为空'
                            },
                            dbname: {
                                required	: '数据库名不能为空'
                            },
                            dbprefix : {
                                required	: '数据库表前缀不能为空'
                            },
                            manager_email: {
                                required	: '管理员帐号不能为空'
                            },
                            manager_pwd: {
                                required	: '密码不能为空'
                            },
                            manager_ckpwd: {
                                required	: '重复密码不能为空',
                                equalTo : '两次输入的密码不一致。请重新输入'
                            }
                        },
                        submitHandler:function(form) {
                            form.submit();
                            return true;
                        }
                    });
                    var _data = {};
                });
            </script>
        </div>
        <?php require './templates/footer.php'; ?>
    </body>
</html>

9. [代码]s4.php    

<!doctype html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>WeMall微信商城管理系统</title>
        <link rel="stylesheet" href="./css/install.css?v=9.0" />
    </head>
    <body>
        <div class="wrap">
            <?php require './templates/header.php'; ?>
            <section class="section">
                <div class="">
                    <div class="success_tip cc"> <a href="../index.php" class="f16 b">安装完成,进入后台管理</a>
                   </div>
                    <div class=""> </div>
                </div>
            </section>
        </div>
        <?php require './templates/footer.php'; ?>
    </body>
</html>
网友评论