⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 web_setup.jsp

📁 用JSP写的一个在线购物网站的代码
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312" import="java.sql.*" %>
<jsp:useBean id="data" scope="page" class="shop.data.conn" />
<%
String admin=(String)session.getValue("admin");
if(admin=="" || admin==null)
{%>
<script language="javascript">
alert("请登陆后再执行管理操作");
self.location="index.jsp";
</script>
<%}else{
String sql="select * from admin where admin='"+admin+"'";
ResultSet rs=data.executeQuery(sql);
if(!rs.next())
{%>
<script language="javascript">
alert("对不起,无此管理员帐号");
history.back();
</script>
<%}}%>
<style type="text/css">
<!-- @import url(../images/css.css); -->
</style>
<%
String sql="select * from shopother";
ResultSet rs=data.executeQuery(sql);
if(rs.next())
{
String http=rs.getString("http");
String webname=rs.getString("webname");
String email=rs.getString("email");
String address=rs.getString("address");
String zipcode=rs.getString("zipcode");
String tel=rs.getString("tel");
String movetel=rs.getString("movetel");
String copyright=rs.getString("copyright");
String logo=rs.getString("logo");
%>
<form action="" method="post">
<input type="hidden" name="install" value="">
<table width="502" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30" bgcolor="3969A5"><div align="center"><font color="#FFFFFF">网站信息设置</font></div></td>
  </tr>
</table>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#999999">
  <tr>
  <td height="15" bgcolor="#FFFFFF"></td>
  </tr>
  <tr>
    <td><table width="500" border="0" align="center" cellpadding="0" cellspacing="1">
		  <tr> 
            <td width="120" height="30" bgcolor="#FFFFFF"><div align="right">网站网址:</div></td>
            <td bgcolor="#FFFFFF"> <input type="text" name="http" size="40" maxlength="50" value="<%=http%>" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
          </tr>
          <tr> 
            <td height="30" bgcolor="#FFFFFF"><div align="right">网站名称:</div></td>
            <td bgcolor="#FFFFFF"> <input type="text" name="webname" size="40" maxlength="20" value="<%=webname%>" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
          </tr>
          <tr> 
            <td height="30" bgcolor="#FFFFFF"><div align="right">公司邮件:</div></td>
            <td bgcolor="#FFFFFF"> <input type="text" name="email" size="40" maxlength="50" value="<%=email%>" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
          </tr>
          <tr> 
            <td height="30" bgcolor="#FFFFFF"><div align="right">公司地址:</div></td>
            <td bgcolor="#FFFFFF"> <input type="text" name="address" size="40" maxlength="100" value="<%=address%>" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
          </tr>
          <tr> 
            <td height="30" bgcolor="#FFFFFF"><div align="right">公司邮编:</div></td>
            <td bgcolor="#FFFFFF"> <input type="text" name="zipcode" size="40" maxlength="6" value="<%=zipcode%>" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
          </tr>
          <tr> 
            <td height="30" bgcolor="#FFFFFF"><div align="right">公司电话:</div></td>
            <td bgcolor="#FFFFFF"> <input type="text" name="tel" maxlength="18" size="40" value="<%=tel%>" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
          </tr>
          <tr> 
            <td height="30" bgcolor="#FFFFFF"><div align="right">移动电话:</div></td>
            <td bgcolor="#FFFFFF"> <input type="text" name="movetel" maxlength="13" size="40" value="<%=movetel%>" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
          </tr>
          <tr> 
            <td height="30" bgcolor="#FFFFFF"><div align="right">网站版权:</div></td>
            <td bgcolor="#FFFFFF"> <input type="text" name="copyright" size="40" maxlength="50" value="<%=copyright%>" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
          </tr>
          <tr> 
            <td height="30" bgcolor="#FFFFFF"><div align="right">网站Logo:</div></td>
            <td bgcolor="#FFFFFF"> <input type="text" name="logo" size="40" maxlength="50" value="<%=logo%>" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
          </tr>
        </table></td>
		<tr>
		<td height="10" bgcolor="#FFFFFF"></td>
		</tr>
		<tr>
		<td height="25" bgcolor="#FFFFFF"><div align="center">
          <input name="submit" type="submit" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva" onClick="document.all.install.value='true';" value="配置">
          <input name="reset" type="reset" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva" value="复位">
        </div></td>
		</tr>
		<tr>
		<td height="10" bgcolor="#FFFFFF"></td>
		</tr>
  </tr>
</table>
<table width="502" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="25" bgcolor="3969A5"></td>
  </tr>
</table>
</form>
<%}
rs.close();
%>
<%
String install=request.getParameter("install");
if(install!=null && install.equals("true"))
{
String http=request.getParameter("http");
http=new String(http.getBytes("ISO8859_1"),"GBK");
String webname=request.getParameter("webname");
webname=new String(webname.getBytes("ISO8859_1"),"GBK");
String email=request.getParameter("email");
email=new String(email.getBytes("ISO8859_1"),"GBK");
String address=request.getParameter("address");
address=new String(address.getBytes("ISO8859_1"),"GBK");
String zipcode=request.getParameter("zipcode");
zipcode=new String(zipcode.getBytes("ISO8859_1"),"GBK");
String tel=request.getParameter("tel");
tel=new String(tel.getBytes("ISO8859_1"),"GBK");
String movetel=request.getParameter("movetel");
movetel=new String(movetel.getBytes("ISO8859_1"),"GBK");
String copyright=request.getParameter("copyright");
copyright=new String(copyright.getBytes("ISO8859_1"),"GBK");
String logo=request.getParameter("logo");
logo=new String(logo.getBytes("ISO8859_1"),"GBK");

sql="update shopother set http='"+http+"',webname='"+webname+"',email='"+email+"',address='"+address+"',zipcode='"+zipcode+"',tel='"+tel+"',movetel='"+movetel+"',copyright='"+copyright+"',logo='"+logo+"'";
rs=data.executeQuery(sql);
response.sendRedirect("web_setup.jsp");
}
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -