出现空白页面的源码如下:
<?php
$showErr = false;
if (isset($_POST['username'])) {
$pass = md5($_POST['password']);
$sql = "SELECT * FROM user WHERE username='{$_POST['username']}' and password='$pass'";
$result = execQuery($sql, BASEDB);
$data = mysql_fetch_assoc($result);
if (!$data) {
$sql = "INSERT INTO `loginlog` (userid, logtime, ip) VALUES ('0', now(), '{$_SERVER['REMOTE_ADDR']}')";
} else {
$sql = "INSERT INTO `loginlog` (userid, logtime, ip) VALUES ('{$data['userid']}', now(), '{$_SERVER['REMOTE_ADDR']}')";
}
execQuery($sql, BASEDB);
if ($data) {
session_start();
//session_register('user');
$_SESSION['user'] = $data['username'];
$_SESSION['flag'] = $data['flag'];
if ($_POST['lang'] != 'default')
$_SESSION['code'] = $_POST['lang'];
else
$_SESSION['code'] = $data['code'];
$_SESSION['realname'] = iconv(SYSCHARSET, $_SESSION['code'], $data['realname']);
$_SESSION['store'] = '1';
echo "**********window.location = \"out.php\";</script>";
exit();
} else {
$showErr = true;
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php echo iconv('GB2312', 'UTF-8', '页面')?></title>
</head>
<body onload="document.form1.username.focus();">
<form name="form1" method="post" action="">
<table width="100%" height="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="56%" height="150" align="right" style="border-right:2px solid #990000 "><img src="images/indextitle.gif" width="400" height="88"></td>
<td style="padding-left:20px" width="44%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="2"></td>
</tr>
<tr>
<td><img src="images/log_03.gif" width="58" height="18">
<input name="username" type="text" size="15" class="textfield" maxlength="16">
</td>
</tr>
<tr>
<td style="color:#FFCC00"><img src="images/log_06.gif" width="58" height="18">
<input name="password" type="password" size="15" class="textfield" maxlength="16"><?php if($showErr) echo iconv('GB2312', 'UTF-8', '密码错!'); ?></td>
</tr>
<tr>
<td height="30">
<input name="imageField" type="image" src="images/login.gif" width="39" height="15" border="0">
<input name="imageField" type="image" src="images/reset.gif" width="39" height="15" border="0" onClick="document.form1.reset();return(false);"></td>
</tr>
<tr>
<td>
<input type="radio" name="lang" value="default" checked><?php echo iconv('GB2312', 'UTF-8', '默认');?>
<input type="radio" name="lang" value="GB2312"><?php echo iconv('GB2312', 'UTF-8', '简体');?>
<input type="radio" name="lang" value="BIG5">繁体
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
******************************MSN:
coco@scn.com.cn 可以交流编程技巧