📄 regist.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<script language="javascript">
function f()
{
if (aa.name.value=="")
{
alert("用户名不能为空!");
return false;
}
if (aa.pwd.value=="")
{
alert("密码不能为空!");
return false;
}
return true;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
a:link {
color: #FF0000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #ECE9D8;
}
a:hover {
text-decoration: none;
color: #00FF00;
}
a:active {
text-decoration: none;
}
.STYLE1 {color: #FF0000}
-->
</style></head>
<%String namess;
namess=(String)session.getAttribute("usernames");
%>
<body>
<script LANGUAGE="JavaScript">
<!--
function openwin() {
window.open ("add.jsp", "", "height=100, width=100, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}
</script>
<FORM name="aa" METHOD=POST ACTION="add.jsp" onSubmit="return f()">
用户名:
<INPUT TYPE="text" NAME="name" value="" >
</a><br>
密 码:
<INPUT TYPE="password" NAME="pwd">
<br>
性 别:
<input type="radio" name="radiobutton" value="男" checked>
男
<input type="radio" name="radiobutton" value="女">
女<br>
个人说明:<br>
<TEXTAREA NAME="textarea" ROWS="3" COLS="30"></TEXTAREA>
<br>
<INPUT TYPE="submit" value="注册" >
<input type="reset" name="Submit" value="重设">
</FORM>
<%/*request.setCharacterEncoding("gb2312");
String flag;
flag=request.getParameter("flag");
if(name.value==null){}else{
String username=request.getParameter("name");
session.setAttribute("usernames",username);
out.print(username);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:test","sa","sa");
String sq="select * from gly where name='"+username+"'";
Statement set=con.createStatement();
ResultSet rs=set.executeQuery(sq);
if(rs.next()){
out.print("<script>alert('该用户名已经存在,请重新选择用户名!');location.href='regist.jsp'</script>");
}
else{
out.print("<script>alert('恭喜您可以使用该用户名!')</script>");%>
<%}
con.close();
}*/%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -