<?php
	require("session_check.php");	
	
	//变量区
	$skin_name=short_check(get_argg('skin_name'));
	
	$dbo = new dbex;
	dbtarget('w',$dbServs);
	
	//表定义区
	$t_config=$tablePreStr."config";
	$sql="update $t_config set v = '$skin_name' where k = 'skin' ";
	if($dbo->exeUpdate($sql)){
		$conf_str=file_get_contents("../configuration.php");
		$change_conf=preg_replace('/\$skinUrl=\".*\"/', '\$skinUrl="'.$skin_name.'"' ,$conf_str,1);
		$conf_ref=fopen("../configuration.php","w+");
		fwrite($conf_ref,$change_conf);
	}
	echo '<script type="text/javascript">window.history.go(-1);</script>';
?>