www.gusucode.com > 仿51.com的php源码 1.1 > User/InputPhotoPass.php

    <?php
include("CheckLogined.php");
include("../include/dbclass.php");
$dbc=new DbConn();
$uid=$_COOKIE["uid"];
$gname=$_GET["gname"];
if ($_GET["act"]=="save")
{
$gname=$_GET["gname"];
$password=$_POST["password"];
$sql="update PhotoGroup set GroupPassWord='$password',hiddenGroup='2' where User_Account='$uid' and GroupName='$gname'";
$dbc->Execute($sql);
echo "<script>alert('密码设置成功!');window.close();</script>";
}
?><!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{ margin:0}
*{font-size:12px;}
</style>
</head>
<body>
<script>
try{
	if(top!=window){
		document.domain	="www.wu-liao.com";		
	}else{
		top.location.href="/webin.php?refer=%2FUser%2FInputPhotoPass.php";
	}
}catch(e){}
function showNewMessage(user){
	top.showNewMessage(user);
}

</script>
<script language="JavaScript">
<!--
//document.domain='51.com';
function do_pass(){
	if (document.all('password').value.length > 12)
	{
		alert('密码不能超过12位');
		return false;
	}
	if (document.all('password').value.length < 3)
	{
		alert('密码不能少于3位');
		return false;
	}
	theform.submit();
	//window.opener.set_pass(document.all('password').value, '我的照片');
}
//-->
</script>
<body onunload="window.opener.location.reload()">
<table width="280" border="0" align="center" cellpadding="5" cellspacing="0">
<form action='?act=save&gname=<?php echo $gname; ?>' method=post name=theform>
<tr>
<td height="16"><br><br>请设置密码:
<input name="password" type="password" size="14" />
<input type="button" name="" value="提交" onclick="do_pass()" /></td>
</tr>
<tr>
<td  style="line-height:20px">1.设置密码后,只有知道此密码的人,才有权查看此分类的照片<br><font color=red>2.为了安全起见,您设置的密码不能与主页登录密码及二级密码相同</font></td>
</tr>
</form>
</table>
</body>
</html>