<?php
session_start();
include("conn/conn.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=utf-8" />
<link href="css/css.css" rel="stylesheet" type="text/css" />
<title>常州纺织服装职业技术学院 学生自助请假管理系统</title>
</head>
<body>
<div id="content" class="content">
<table width="546" height="250" align="center">
<tr><td>
<fieldset>
<p> </p>
<script language="javascript">
function chkuserinput(form){
if(form.SID.value==""){
alert("请输入用户名!");
form.SID.select();
return(false);
}
if(form.PSD.value==""){
alert("请输入用户密码!");
form.PSD.select();
return(false);
}
if(form.yzm.value==""){
alert("请输入验证码!");
form.yzm.select();
return(false);
}
return(true);
}
</script>
<form name="form2" action="loginCheck.php" method="post" onSubmit="returnchkuserinput">
<p align="center">常州纺织服装职业技术学院 学生自助请假系统<br/>
</p>
<table width="348" height="197" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="141" class="td"><div align="right">学号:</div></td>
<td colspan="2"><label>
<input name="SID" type="text" class="inp" id="SID" tabindex="1"/>
</label></td>
</tr>
<tr>
<td class="td"><div align="right">登录密码:</div></td>
<td colspan="2"><label>
<input name="PSD" type="password" class="inp" id="PSD" tabindex="2"/>
</label></td>
<tr>
<td height="47" class="td">
<div align="right">验证码: </div></td>
<td width="79" height="47">
<input name="yzm" type="text" class="inp1" id="yzm" size="7" maxlength="6" tabindex="3" onfocus="document.login.code.style.display='block';" /></td>
<td width="128">
<?php
$num=intval(mt_rand(1000,9999));
//使用到了mt_rand()函数调用介于1000-9999的任意一个数字。
for($i=0;$i<4;$i++){
echo "<img src=images/code/".substr(strval($num),$i,1).".gif>";}
?>
</td>
</tr>
<tr>
<td height="64" colspan="3"><label>
<form method="post" action="loginCheck.php">
<div align="center">
<input name="login" type="submit" id="login" value="登陆" class="elButton"/>
<input name="reset" type="reset" id="reset" value="重置" class="elButton" />
</div>
</form>
</table>
<p><span><small> &n bsp; *登陆密码初始值为学号,进入系统后可以进行修改</small></span></p>
</form>
</td>
</tr>
</div>
</body>
</html>
一点登陆就跳出来那个