Php website online installation source code
Script ec (2); script
/*
+ -------------------------------------------
|
| Technology of WeSpace Software
| ================================================ =
| Powered by WeSpace
| (C) 2006 wane.net
| F_Space Ver3.x
| ================================================ =
| Site: http://www.wesofts.com
|
+ -------------------------------------------
| Autohr: wsfuyibing
| Mail: websearch@163.com
| MSN: websearch@163.com
+ -------------------------------------------
*/
Error_reporting (E_ERROR | E_WARNING | E_PARSE );
Set_magic_quotes_runtime (0 );
Define ('in _ www.111cn.net ', true );
Define ('in _ LICENSED ', true );
Define ('wane _ root ','../');
$ Timestamp = time ();
$ Configfile = '../config. inc. php ';
/*
+ -------------------------------------------
+ Check PHP version
+ -------------------------------------------
*/
If (@ phpversion () <'4. 1.0 ')
{
$ _ COOKIE = & $ HTTP_COOKIE_VARS;
$ _ SERVER = & $ HTTP_SERVER_VARS;
$ _ FILES = & $ HTTP_POST_FILES;
$ _ GET = & $ HTTP_GET_VARS;
$ _ POST = & $ HTTP_POST_VARS;
}
/*
+ -------------------------------------------
+ Language
+ -------------------------------------------
*/
$ Lang = in_array ($ _ GET ['lang '], array ('gbk', 'big5', 'utf-8-gbk', 'utf-8-big5 '))? $ _ GET ['lang ']: 'utf-8-gbk ';
$ Charset = substr ($ lang, 0, 5 );
If (! File_exists ('./'. $ lang. '/language. php '))
{
Exit ('can not load language file .');
}
Else
{
Require_once './'. $ lang. '/language. php ';
}
/*
+ -------------------------------------------
+ Step
+ -------------------------------------------
*/
$ Step = file_exists ('../upload/install. lock ')? '0': ($ _ GET ['step']? $ _ GET ['step']: '1 ');
$ Steps = 16;
$ Step = $ step> $ steps? $ Steps: $ step;
/*
+ -------------------------------------------
+ Template
+ -------------------------------------------
*/
$ Tpl_header =''. "\ N ";
$ Tpl_header. =''. "\ N ";
$ Tpl_header. =''. "\ N ";
$ Tpl_header. =' '. "\ N ";
$ Tpl_header. =''. $ Tplang ['title'].''. "\ N ";
$ Tpl_header. =' '. "\ N ";
$ Tpl_header. =''. "\ N ";
$ Tpl_header. =''. "\ N ";
$ Tpl_header. ='
'. "\ N \ t ".'
'. "\ N \ t ".'
| '. $ Tplang ['title'].' | '. "\ N \ t ".'
'. ($ Step> 1? $ Tplang ['lang _ '. $ lang].'
':''). $ Tplang ['step _ name']. ':'. $ tplang ['step '. $ step]. '('. $ tplang ['step _ cur']. $ step. $ tplang ['step _ unit ']. '/'. $ tplang ['step _ total']. $ steps. $ tplang ['step _ unit ']. ') | '. "\ N \ t ".'
'. "\ N ".'
'. "\ N ";
$ Tpl_footer ='
'. "\ N \ t ".'
'. "\ N \ t ".'
| '. $ Tplang ['footer'].' | '. "\ N \ t ".'
'. "\ N ".'
'. "\ N ".''. "\ N ";
$ Tpl_footer. ='';
/*
+ -------------------------------------------
+ Start Install
+ -------------------------------------------
*/
If (file_exists ('../upload/install. lock '))
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Elseif ($ step = '1 ')
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Elseif ($ step = '2 ')
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Elseif ($ step = '3 ')
{
Function filewrite ()
{
Return (file_exists ('../config. inc. php') & is_writable (' ../config. inc. php '))? ''. $ GLOBALS ['tplang '] ['yes'].'': ''. $ GLOBALS ['tplang'] ['no'].'';
}
Function dirwrite ($ folder)
{
$ Filename = '../'. $ folder. '/index.htm ';
$ Fp = @ fopen ($ filename, 'W + ');
If (! $ Fp)
{
Return ''. $ GLOBALS ['tplang '] ['no'].'';
}
Else
{
@ Fwrite ($ fp ,'');
Fclose ($ fp );
Return ''. $ GLOBALS ['tplang '] ['yes'].'';
}
}
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Elseif ($ step = '4 ')
{
Function filewrite ()
{
Return (file_exists ('../config. inc. php') & is_writable (' ../config. inc. php '))? ''. $ GLOBALS ['tplang '] ['yes'].'': ''. $ GLOBALS ['tplang'] ['no'].'';
}
If (! File_exists ($ configfile ))
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Else
{
Require_once $ configfile;
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
}
Elseif ($ step = '5 ')
{
Require_once WANE_ROOT. 'Install/query/5. php ';
Header ("location: install. php? Lang = {$ lang} & step = 6 ");
}
Elseif ($ step = '6 ')
{
If (! File_exists ($ configfile ))
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Else
{
Require_once $ configfile;
$ Conn = @ mysql_connect ($ conf ['dbserver'], $ conf ['dbuser'], $ conf ['dbpass']);
Echo $ tpl_header;
If (! $ Conn)
{
?>
}
Else
{
?>
$ Sels = @ mysql_select_db ($ conf ['dbname'], $ conn );
If (! $ Sels)
{
?>
}
Else
{
?>
}
}
Echo $ tpl_footer;
}
}
Elseif ($ step = '7 ')
{
If (! File_exists ($ configfile ))
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Else
{
Echo $ tpl_header;
$ Sqlfile = './SQL/struct. php ';
If (! File_exists ($ sqlfile ))
{
?>
}
Else
{
$ Fp = @ fopen ($ sqlfile, 'R ');
If (! $ Fp)
{
?>
}
Else
{
Require_once WANE_ROOT. 'Install/query/7. php ';
?>
}
}
Echo $ tpl_footer;
}
}
Elseif ($ step> = '8' & $ step <= '14 ')
{
If (! File_exists ($ configfile ))
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Else
{
Echo $ tpl_header;
$ Sqlfile = './'. $ lang. '/data'. $ step.'. php ';
If (! File_exists ($ sqlfile ))
{
?>
}
Else
{
$ Fp = @ fopen ($ sqlfile, 'R ');
If (! $ Fp)
{
?>
}
Else
{
Require_once WANE_ROOT. 'Install/query/8-14.php ';
?>
}
}
Echo $ tpl_footer;
}
}
Elseif ($ step = '15 ')
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Else
{
$ Configsubmit = trim ($ _ POST ['configsubmit ']);
If ($ step = '16' & $ configsubmit)
{
$ Magic = @ get_magic_quotes_gpc ();
Function cutempty ($ varchar)
{
Global $ magic, $ _ POST;
$ Varchar = $ magic? Stripslashes ($ _ POST [$ varchar]): $ _ POST [$ varchar];
Return addslashes (htmlspecialchars (str_replace (array ("", "\ n", "\ t", "\ r"), array ("","","", ""), $ varchar )));
}
$ Username = substr (cutempty ('username'), 0, 15 );
$ Password = cutempty ('Password ');
$ Email = cutempty ('email ');
$ Sex = cutempty ('sex ');
If (! $ Username |! $ Password |! $ Email |! $ Sex)
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
Else
{
Require_once WANE_ROOT. 'Install/query/16. php ';
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
}
Else
{
Echo $ tpl_header;
?>
Echo $ tpl_footer;
}
}
?>