www.gusucode.com > 仿51.com的php源码 1.1 > Photo/PhotoAddGroup.php

    <?php
include("../User/CheckLogined.php");?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>增加新分类</title>
<style type="text/css">
<!--
body {
	background-color: #d4d0c8;
	margin: 0px;
}
.btn{font-size:12px;BORDER:1px solid #002D96;PADDING:2px 2px 0;FONT-SIZE:12px;FILTER:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#9DBCEA);CURSOR:hand;COLOR:black;;background-color:#BFEFFF}
-->
</style>
</head>
<script>
//document.domain="51.com";
//window.parent.frames[1].updateaddtype('fff');
//window.opener.updateaddtype('fff');
function clearsubject(obj)
{
	obj.style.color="#000000";
	if(obj.value=="请填写分类名")
	{
		obj.value="";
	}
}

function chkAddGroupForm(obj)
{

var pattern=/^[\u4e00-\u9fa5a-zA-Z0-9]+$/;
if(obj.gname.value == "")
{
alert("请输入分类名称");
obj.gname.focus();
return false;
}
if(!pattern.test(obj.gname.value))
{
alert("注意:只能是中文,英文或数字");
return false;
}

var pattern1=/^[\u4e00-\u9fa5]+$/;
if(pattern1.test(obj.gname.value))
{
	if(obj.gname.value.length>10)
	{
	 alert('对不起,分类名称过长');
	 return false;
	}
}
else
{
	if(obj.gname.value.length>20)
	{
	 alert('对不起,分类名称过长');
	 return false;
	}
}
//window.opener.location.href='PhotoUploadSimple.php?group="+obj.gname.value.+"';
setTimeout("window.opener.location.href='PhotoUploadSimple.php?group="+obj.gname.value+"';window.close();",1000);

return true;
}
</script>
<script>
try{
	if(top!=window){
		document.domain	="www.wu-liao.com";		
	}else{
		top.location.href="/webin.php?refer=%2FPhoto%2FPhotoAddGroup.php";
	}
}catch(e){}
function showNewMessage(user){
	top.showNewMessage(user);
}

</script>
<body>
<iframe name=addgroup_frame height=0 width=0></iframe>
<br>
<table border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><fieldset align="left" style="border:1px solid #000000">
      <legend align="left" style="color:#000000;font-size:12px">增加新分类</legend>
      <table width="280" height="90" align="center">
	 <form name="form1" method="post" action="PhotoGroup.php?act=addGroup" onsubmit="return chkAddGroupForm(this)" target=addgroup_frame>
        <tr>
          <td height="25" align="center" ><input id="gname" name="gname" size="15" value="请填写分类名" onfocus="clearsubject(this)"/>
&nbsp;<input name="submit" type="submit" value="确定" class="btn" />
&nbsp;<input name="button" type="button" onclick="window.close();" value="取消" class="btn" /></td>
        </tr>
		</form>
      </table>
    </fieldset></td>
  </tr>
</table>
</body>
</html>
<script>
if(document.getElementById("gname").value=="请填写分类名")
{
	document.getElementById("gname").style.color="#c0c0c0";
}
else
{
	document.getElementById("gname").style.color="#000000";
}
</script>