Example #1
0
                }
            }
            $accessMsg = mysql_select_db($dbname, $conn) ? "<font color='red'>数据库已经存在,系统将覆盖数据库</font>" : "<font color='green'>数据库不存在,系统将自动创建</font>";
            $content = getftext('conn.php');
            $s = StrCut($content, 'dbhost=', "';", true, true);
            $content = str_replace($s, 'dbhost=\'' . $dbhost . '\';', $content);
            $s = StrCut($content, 'dbuser='******';", true, true);
            $content = str_replace($s, 'dbuser=\'' . $dbuser . '\';', $content);
            $s = StrCut($content, 'dbpwd=', "';", true, true);
            $content = str_replace($s, 'dbpwd=\'' . $dbpwd . '\';', $content);
            $s = StrCut($content, 'dbname=', "';", true, true);
            $content = str_replace($s, 'dbname=\'' . $dbname . '\';', $content);
            if (is_writable('conn.php')) {
                createFile('conn.php', $content);
            } else {
                echo "出错,没有权限操作文件,手动配置<hr>" . handlePath('conn.php') . '<hr>配置完成后再点下一步<hr>';
            }
            step2();
            exit;
        }
    } else {
        $dbmsg = "<font color='red'>数据库连接失败!</font>";
    }
    @mysql_close($conn);
}
//截取字符串,CutType为1包括截取值 2为不包括截取值
function StrCut($Content, $StartStr, $EndStr, $CutType)
{
    //On Error Resume Next
    $S1 = '';
    $S1Str = '';
Example #2
0
	die(111);
}
*/
$splstr = '';
$s = '';
$conn = OpenConn();
$parentid = '';
$title = '';
$lableName = '';
$content = '';
$tempS = '';
$url = '';
$isdisplay = '';
$nCount = '';
//echo('path='.handlePath('./../admin/后台菜单配置.ini'));
$content = getftext(handlePath('./../admin/后台菜单配置.ini'));
$content = Replace($content, "\t", '    ');
$splStr = aspSplit($content, chr(10));
//不用vbCrlf()  是因为在上传到GitHut上去,下载下来它会把后台菜单配置.ini文件编码转成utf-8 20160409
$nCount = 0;
foreach ($splStr as $s) {
    $tempS = $s;
    $s = AspTrim($s);
    if ($tempS != '' && substr(phptrim($s) . ' ', 0, 1) != '#') {
        $nCount = $nCount + 1;
        //总数
        if (substr($tempS, 0, 4) == '    ') {
        } else {
            $parentid = '-1';
        }
        if (trim(LCase($tempS)) == 'end') {
Example #3
0
function getImageType($imgPath)
{
    $imgPath = handlePath($imgPath);
    $imgType = image_type_to_mime_type(exif_imagetype($imgPath));
    $imgType = str_replace("-", '/', $imgType);
    $imgType = str_replace(".", '/', $imgType);
    $imgType = substr($imgType, strrpos($imgType, '/') + 1);
    if ($imgType == 'jpeg') {
        $imgType = 'jpg';
    }
    return strtolower($imgType);
}