<?
		$iserror = 0;
		
		if($act == "submit"){
				
				if(@$domain == ""){
						$iserror = 1;
						$pagecontent = "访问组件的域名必须输入否则无法正常使用组件！<br/>";
						$tourl = URL_admin_googlead(array("act"=>""));
				}
				
				if($iserror == 0){
						$filecontent = "<?php\n";
						$filecontent .= "global \$wapset;\n";
						$filecontent .= "\$wapset = array(\n";
						$filecontent .= "\"wapdirname\" => \"$wapdirname\",\n";
						$filecontent .= "\"domain\" => \"$domain\",\n";
						$filecontent .= "\"idcno\" => \"$idcno\",\n";
						$filecontent .= "\"client\" => \"$client\",\n";
						$filecontent .= "\"slotname\" => \"$slotname\",\n";
						$filecontent .= "\"key\" => \"$dkey\",\n";
						$filecontent .= ");\n";
						$filecontent .= "?>\n";
						
						/*写入配置文件*/
						$of = fopen('config.php','w');
						fwrite($of,$filecontent);
						fclose($of);
						
						$iserror = 1;
						$pagecontent = "保存成功！<br/>";
						$tourl = URL_admin_googlead(array("act"=>""));
				}
				
		}else{
				
		}
		
		if($iserror == 0){
			
				$smartydate = array("pagetitle" => "网站设置",
														"posturl" => URL_admin_googlead(array("act"=>"editok")),
														"wapset" => $wapset,
													);
    				
				$tplpath = "googlead.tpl";
				
		}else{
			
				$smartydate = array("pagetitle" => "网站设置",
														"pagecontent" => $pagecontent,
														"tourl" => $tourl,
														"redirecturl" => $tourl,
				);
    		
				$tplpath = "public.tpl";
				
		}
?>