用户表: uid (主键,自动增长) uname upwd
使用分层实现注册。(必做)
<%@page import="com.asss.assss"%> <%@page import="com.ass"%> <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% ass s = new ass(); String uname = request.getParameter("uname"); s.setUname(uname); String upwd = request.getParameter("upwd"); s.setUpwd(upwd); assss sd=new assss(); if(sd.addass(s)>0){ //跳转注册成功页面 }else{ //错误页面 } %>
<%@page import="com.ass"%> <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% ass s = new ass(); int id = Integer.parseInt(request.getParameter("sid")); s.setSid(id); String uname = request.getParameter("uname"); s.setUname(uname); String upwd = request.getParameter("upwd"); s.setUpwd(upwd); assss sd=new assss(); if(sd.addStu(s)>0){ //跳转注册成功页面 }else{ //错误页面 } %>