问题描述
这是HTML代码:<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><title>客户登录</title><scripttype="text/javascript"><!--functionMM_validateForm(){//v4.0if(document.getElementById){vari,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;for(i=0;i<(args.length-2);i+=3){test=args[i+2];val=document.getElementById(args[i]);if(val){nm=val.name;if((val=val.value)!=""){if(test.indexOf('isEmail')!=-1){p=val.indexOf('@');if(p<1||p==(val.length-1))errors+='-'+nm+'mustcontainane-mailaddress.n';}elseif(test!='R'){num=parseFloat(val);if(isNaN(val))errors+='-'+nm+'mustcontainanumber.n';if(test.indexOf('inRange')!=-1){p=test.indexOf(':');min=test.substring(8,p);max=test.substring(p+1);if(num<min||max<num)errors+='-'+nm+'mustcontainanumberbetween'+min+'and'+max+'.n';}}}elseif(test.charAt(0)=='R')errors+='-'+nm+'isrequired.n';}}if(errors)alert('Thefollowingerror(s)occurred:n'+errors);document.MM_returnValue=(errors=='');}}//--></script></head><body><formaction="../Scripts/login.jsp"method="post"><tablealign="center"><trbordercolor="#CCCC99"><tdcolspan="2"align="center"><fontsize="6"face="华文行楷">客户登录</font></td></tr><tr><tdwidth="18%"height="30"align="left"valign="middle">用户名:</td><tdwidth="82%"height="30"align="left"><inputname="tUser"type="text"id="tUser"onblur="MM_validateForm('tUser','','R','tPssword','','R');returndocument.MM_returnValue"size="12"maxlength="12"></td></tr><tr><tdheight="30"align="left"valign="middle">密码:</td><tdheight="30"><inputname="tPssword"type="password"id="tPssword"size="18"maxlength="50"></td></tr><tralign="center"valign="middle"><tdheight="40"colspan="2"><inputtype="submit"name="Submit"value="登录"> <inputtype="reset"name="Submit"value="取消"></td></tr></table></form></body></html>这是jsp代码:<%@pagecontentType="text/html;charset=utf-8"language="java"import="java.sql.*"errorPage=""%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><title>用户登录</title></head><body><%request.setCharacterEncoding("UTF-8");StringtName1=request.getParameter("tName");StringtPassword1=request.getParameter("tPassword");Stringdriver="sun.jdbc.odbc.JdbcOdbcDriver";Stringurl="jdbc:odbc:srcdb";Class.forName(driver);Connectionconn=DriverManager.getConnection(url);StringtPassword="selecttPasswordfromUserwheretName=tName1";if(tPassword==tPassword1){out.print("您已成功登陆!");}else{out.print("对不起,密码错误!");}pstmt.close();conn.close();%></body></html>我要写的是用户登录页面,谁能帮我看下错哪里了?
解决方案
解决方案二:
能把你的错误代码贴出来么~~!
解决方案三:
你QQ多少?我加下你吧
解决方案四:
看看错误代码
解决方案五:
错在哪?
解决方案六:
错误在那里?
解决方案七:
数据库连接语句错了
解决方案八:
说清问题啊
解决方案九:
首先你得把错误Log贴出来啊这样才能定位的还有请问StringtName1=request.getParameter("tName");这句话什么意思获取的tName来源是??还是我没有看清楚···