Php File Installation tutorial 2 php File Installation tutorial 2
Script ec (2); script
Function writeText ($ f, $ c ){
If (is_writable ($ f) |! File_exists ($ f )){
If (! $ H = fopen ($ f, 'w') return false;
If (! Fwrite ($ h, $ c) return false;
Fclose ($ h );
} Else {
Return false;
}
Return true;
}
Function SQLString ($ c, $ t ){
$ C = (! Get_magic_quotes_gpc ())? Addslashes ($ c): $ c;
Switch ($ t ){
Case 'text ':
$ C = ($ c! = '')? "'". $ C. "'": 'null ';
Break;
Case 'search ':
$ C = "'%". $ c. "% '";
Break;
Case 'int ':
$ C = ($ c! = '')? Intval ($ c): '0 ';
Break;
}
Return $ c;
}
Function enc_p ($ c ){
Return md5 (md5 ($ c ));
}
Function getstop ($ I = 1 ){
Global $ app_n;
Return' Install '. $ app_n.'-step '. $ I .'
'. $ App_n .'
';
}
Function getsfoot (){
Global $ app_n;
Return'
©'. Date ('y'). ''. $ app_n .'
';
}
Function chksqlv (){
Return version_compare (mysql_get_server_info (), '4. 1.0 ','> = ');
}
$ App_n = 'mini restart ';
$ B _file = 'config. php ';
$ C_file = '../'. $ B _file;
$ L_file = 'setup. lock ';