欢迎来到我们论坛,以下内容只用注册用户可见
如果您已经注册过,那么请直接登录
如果您还未注册,那么请选择注册
<%@ include file="footer.jsp" %>Login.jsp
Login_ok.jsp <% String username=request.getParameter("username"); username=new String(username.getBytes("ISO8859_1"), "GBK"); String pwd=request.getParameter("pwd"); //out.print(username+pwd); String spath="\\database\\data.mdb"; //注意
7、由网站根到文件的路径,用到了转义字符 String dbpath = application.getRealPath(spath); //转化成物理路径 String url="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="+dbpath; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn=DriverManager.getConnection(url); Statement stmt=conn.creat
8、eStatement();
String sql="select * from admin where username='"+username+"' and password='"+pwd+"'";
//out.print(sql);
ResultSet rs=stmt.executeQuery(sql);
if(rs.next())
{
session.setAttribute("name",username);
out.print("登陆成功!");
%>
9、 <% } else { out.print("用户名或密码错误,请重新登陆!"); } rs.close(); stmt.close(); conn.close(); %> Main1.jsp
Menu.jsp <%=session.getAttribute("name")%>欢迎你 退出
目录
11、ay
Article.jsp
| 标题 | 发帖人 | 回复 |
| 五月 | bob | 0 |
| 毕业季 | John | 3 |
| 开悟 | Mary | 2 |
Cosplay.jsp
15、"D:\JSP\code\jspBBS\WebContent\image\10.jpg"> Bob.jsp <% if(session.getAttribute("name")==null) { response.sendRedirect("login.jsp"); } else { %>
16、
五月的晴空,云散,天净如洗; 五月的热风,一路,将枝头的青杏催熟,将原野的麦浪染黄。 荼蘼架上的满眼繁芜,为残春画着最后的感叹号,夏却欢声笑语,盛装入驻。 抖落惜春的失意,抛开记忆的伤痛,从浮浮沉沉的梦里,醒来,绿叶成荫。
17、orm id="form1" name="form1" action="deal.jsp" method="post" >
主题:
内容:
返回主页