今天在玩一个登陆界面时,title和下拉列表中调用的数据库数据文字出现了乱码,不知道怎么回事儿……
数据库操作问题,还是字体编码问题?怎么改呢?
求教!
<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<!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>
</head>
<body>
<form action="index2.asp" method="post"><table width="1000" height="666"border="0" background="images/login4.jpg" align="center" cellpadding="0" cellspacing="0">
<tr height="150"><td height="310" colspan="2"></td></tr>
<tr>
<td height="46" colspan="2" align="center" valign="middle"><h2><strong>在线考试登陆系统</strong></h2></td>
</tr>
<tr>
<td width="389" height="0" align="right"><strong>班级:</strong></td>
<td width="611" height="35"><%
set rsclass=server.createobject("adodb.recordset")
sqlclass = "select * from Sclass"
rsclass.open sqlclass,conn,1,1
if rsclass.eof and rsclass.bof then
response.write "请先添加班级"
else
%>
<select name="sclass" id="sclass" onselect="show()">
<option value="">请选择班级</option>
<%
dim selclass
selclass=rsclass("Cname")
do while not rsclass.eof
%>
<option value="<%=trim(rsclass("Cname"))%>"><%=trim(rsclass("Cname"))%></option>
<%
rsclass.movenext
loop
end if
rsclass.close
%>
</select></td>
</tr>
<tr>
<td width="389" height="40" align="right"><strong>姓名:</strong></td>
<td width="611" height="35"><label>
<input type="text" name="textfield" id="textfield">
</label></td>
</tr>
<tr>
<td width="389" height="40" align="right"><strong>学号:</strong></td>
<td width="611" height="35"><label>
<input type="text" name="textfield2" id="textfield2">
</label></td>
</tr>
<tr>
<td height="40" align="center"></td>
<td height="35" align="left"><input type="submit" name="button" id="button" value="登陆" /></td>
</tr>
<tr>
<td height="0" colspan="2" align="center" valign="bottom"></td>
</tr>
</table>
</form>
</body>
</html> |
|