<?php
include '../comm/config.php';
include '../comm/checkpostandget1.php';
session_start();
if($_SESSION["username"]!="")
{
	header('Location: usercenter.php');
}
?>
<?php
include '../comm/config.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>回答验证问题 - <?php echo $webtitle;?></title>
<link href="../images/style1.css" rel="stylesheet" type="text/css" />
<link href="../css/qqhk.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function checkanswer()
{
	var answer=document.getElementById("pass_answer").value;
    	if(answer =="")
		{
			document.getElementById("ckanswer").innerHTML = '<img src=../images/cuo.gif alt="错误" align=absmiddle /> <font color=#ff0000>问题答案不能为空！</font>';
			return false;
		}
		else
		{
			document.getElementById("ckanswer").innerHTML = '<img src=../images/dui.gif alt="正确" align=absmiddle /> <font color=#009900>问题答案格式正确！</font>';
			return true;
		}
}    

function checkall()
{
	if(checkanswer())
	{
		return true;
		
	}
	else
	{
		
		return false;
		
	}
}

</script>
<style type="text/css">
<!--
.STYLE1 {
	color: #0000CC;
	font-weight: bold;
	font-size: 24px;
}
-->
</style>
</head>
<?php
include("../regheader.php");
?>
<body>
<form action="chkpostanswer.php" method="post" name="form" id="form" onsubmit="return checkall()">
<?php 
	require_once "../comm/conn.php";
    $username = $_POST["username"]; $con = @mysql_connect("$dbserver","$dbuser","$dbpass" )or die("can not connect to the dbserver!");    
    mysql_select_db("$dbname",$con)or die("can not choose the dbname!"); 
    $query="select * from user where ddusername='".$username."';";
	mysql_query("set names gbk");
    $res=mysql_query($query);
	$rs =mysql_fetch_array($res);
?>
	<div id="maincenterright"><div id="logo"></div><table width="377" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="79" height="30" align="right">&nbsp;&nbsp;用户名 *</td>
                      <td width="135" height="30">&nbsp;&nbsp;
                            <input name="username" type="text" disabled value="<?=$rs["ddusername"]?>" size="20" maxlength="20" style="width:120px;" />
							  <input type="hidden" name="usename" value="<?=$rs["ddusername"]?>" /> 
                      </td>
                      <td width="163" height="30" id="ckusername"></td>
                    </tr>
                   <tr>
                      <td width="79" height="30" align="right">&nbsp;&nbsp;密码问题*</td>
                      <td width="135" height="30">&nbsp;&nbsp;
                            <input name="pass_question" type="text" disabled value="<?=$rs["uquestion"]?>" size="20" maxlength="20" style="width:120px;" />
                     </td>
                      <td width="163" height="30"></td>
      </tr>
					<tr>
                      <td width="79" height="30" align="right">&nbsp;&nbsp;问题答案*</td>
                      <td width="135" height="30">&nbsp;&nbsp;
                            <input name="pass_answer" type="text" value="" onblur="checkanswer();" id="pass_answer" size="20" maxlength="20" style="width:120px;" />
                      </td>
                      <td width="163" height="30" id="ckanswer">请输问题答案</td>
                    </tr>
                    <tr>
                      <td height="30">&nbsp;</td>
                      <td height="30">&nbsp;&nbsp;
                      <input type="submit" name="Submit" value=" 下一步 " class="btn2" /></td>
                      <td height="30"></td>
                    </tr>
                  </table></div>
				  <div class="clear"></div>
</div>

<?php
mysql_close();
include("../footer.php");
?></form>
</body>
</html>
