时间:2023-07-31 08:33:01 | 来源:网站运营
时间:2023-07-31 08:33:01 来源:网站运营
java实现一个旅游网站: 导读:采用JSP和Java语言以及html脚本语言,同时采用B/S模式,进行各个界面和每个功能的设计与实现,后台管理与设计选用了SQL Server 2005数据库,前台设计与后台管理相结合,共同完成各功能模块的功能。 <script language="javascript"> function check() { if(document.form1.yonghuming.value==""){alert("请输入用户名");document.form1.yonghuming.focus();return false;}if(document.form1.mima.value=="") {alert("请输入密码");document.form1.mima.focus();return false;}if(document.form1.xingming.value=="") {alert("请输入姓名");document.form1.xingming.focus();return false;} } functiongow() { document.location.href="yonghuzhuce_add.jsp?jihuabifffanhao="+document.form1.jihuabifffanhao.value; } </script>
<link rel="stylesheet" type="text/css" href="<%=path %>/css/base.css" /> curpage=1; } if (curpage==0) { curpage=1; } if(curpage>zys) { curpage=zys; } //out.print(curpage); String sql="select top "+page_record+" * from shangpinxinxi where id not in (select top "+((curpage-1)*page_record)+" id from shangpinxinxi order by id desc) "; if(sc.equals("")) {} else { sql=sql+" and "+ltt+" like '%"+qd+"%'"; } sql=sql+" order by id desc"; ResultSetRS_result=connDbBean.executeQuery(sql); while(RS_result.next()){ i=i+1; j=j+1; id=RS_result.getString("id"); bianhao=RS_result.getString("bianhao"); mingcheng=RS_result.getString("mingcheng"); tupian=RS_result.getString("tupian"); %>
<% String jiudianmingcheng=request.getParameter("jiudianmingcheng");String kefangbianhao=request.getParameter("kefangbianhao");String jiage=request.getParameter("jiage");String yudingshijian=request.getParameter("yudingshijian");String yudingtianshu=request.getParameter("yudingtianshu");String nindexingming=request.getParameter("nindexingming");String nindedianhua=request.getParameter("nindedianhua");String nindeshenfenzheng=request.getParameter("nindeshenfenzheng");String beizhu=request.getParameter("beizhu");String yonghuming=request.getParameter("yonghuming"); String id=request.getParameter("id"); String sql="update jiudianyuding set jiudianmingcheng='"+jiudianmingcheng+"',kefangbianhao='"+kefangbianhao+"',jiage='"+jiage+"',yudingshijian='"+yudingshijian+"',yudingtianshu='"+yudingtianshu+"',nindexingming='"+nindexingming+"',nindedianhua='"+nindedianhua+"',nindeshenfenzheng='"+nindeshenfenzheng+"',beizhu='"+beizhu+"',yonghuming='"+yonghuming+"' where id= "+id; connDbBean.executeUpdate(sql); out.print("<script>alert('修改成功!!'); location.href='jiudianyuding_updt.jsp?id="+id+"';</script>"); %>
String uid=request.getParameter("username"); String pwd=request.getParameter("pwd"); String cx=new String(request.getParameter("cx").getBytes("8859_1")); String sql=""; if(cx.equals("员工")) { sql="select * from [yuangongxinxi] where yonghuming='"+uid+"' and mima='"+pwd+"'"; } else { sql="select * from [allusers] where username='"+uid+"' and pwd='"+pwd+"'"; } ResultSetRS_result=connDbBean.executeQuery(sql); if(!RS_result.next()) { out.print("<script>alert('你输入的用户不存在或密码错误,请重新登录!'); window.history.go(-1);</script>"); } else{ session.setAttribute("username",uid); if(cx.equals("员工")) { session.setAttribute("cx","员工"); } else { session.setAttribute("cx",RS_result.getString("cx")); } response.sendRedirect("main.jsp"); } RS_result.close(); %> 在实现自驾游路线管理模块中,管理员可以对路线进行实时修改和更新,以方便广大用户进行路线的选择。 <% intcurpage=1;//当前页 intpage_record=10;//每页显示的记录数 intzgs=0; intzys=0; //用下面的方法(sql查询完成,速度快) String hsgnpage=request.getParameter("page"); String fysql="select count(id) as ss from shangpinxinxi"; ResultSetRS_resultfy=connDbBean.executeQuery(fysql); while(RS_resultfy.next()){ zgs=Integer.parseInt(RS_resultfy.getString("ss")); zys=zgs/page_record+1; } if (hsgnpage!=null) { curpage=Integer.parseInt(request.getParameter("page"));//获取传递的值,需要显示的页 } else { curpage=1; }
关键词:旅游,实现