<?php
!function_exists('adminmsg') && exit('Forbidden');
$basename="$admin_file?adminjob=sethtm";

if(!$_POST['step']){
	ifcheck($db_htmifopen,'htmifopen');
	!$db_dir && $db_dir='.php?';
	!$db_ext && $db_ext='.html';
	include PrintEot('sethtm');exit;
} elseif($_POST['step']==2){
	InitGP(array('config'),'P');
	foreach($config as $key=>$value){
		$db->pw_update(
			'SELECT db_name FROM pw_config WHERE db_name='.pwEscape('db_'.$key),
			'UPDATE pw_config SET db_value='.pwEscape($value).'WHERE db_name='.pwEscape('db_'.$key),
			'INSERT INTO pw_config SET db_name='.pwEscape('db_'.$key).',db_value='.pwEscape($value)
		);
	}
	updatecache_c();
	adminmsg('operate_success');
}
?>