📄 reg.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<% request.setCharacterEncoding("gb2312");%>
<%@ include file="conn.jsp"%>
<%
//┌─ 橘子留言系统 ──────── www.f-4113.com ────┐
//│ │
//│ 感谢你使用 橘子留言系统 │
//│ 本代码完全公开和免费,你可以任意复制、传播、修改和使用, │
//│ 但不得公开发表代码 不得用做商业用途,不得向其他使用者收费│
//│ │
//│ 使用时,请保留此段信息,谢谢配合 │
//│ │
//│ 作者:_試着黑 2006/12/07 │
//│ │
//└────────────────── QQ:20886746 ──┘
%>
<%String action=request.getParameter("action");%>
<%
if(action.equals("out"))
{
session.invalidate();
response.sendRedirect("index.jsp");
}
%>
<%
if(action.equals("del"))
{String id=request.getParameter("id");
Statement stmt_DEL=conn.createStatement();
String Sql="delete from book where id="+ id;
int shan=stmt_DEL.executeUpdate(Sql);
stmt_DEL.close();
conn.close(); //关闭连接对象
response.sendRedirect("index.jsp");
}
%>
<%
if(action.equals("add"))
{
String Name=request.getParameter("name");
String title=request.getParameter("title");
String home=request.getParameter("home");
String qq=request.getParameter("qq");
String mail=request.getParameter("mail");
String dd=request.getParameter("dd");
String text=request.getParameter("text");
Statement stmt_add=conn.createStatement();
String sql1="insert into [book] ([name],title,[mail],qq,[text],dd,[home]) values ('" +Name+ "','" +title+ "','" +mail+ "','" +qq+ "','" +text+ "','" +dd+ "','" +home+ "')";
int add=stmt_add.executeUpdate(sql1);
if(add>0){
stmt_add.close();
conn.close(); //关闭连接对象
response.sendRedirect("index.jsp");
}
}
%>
<%
if(action.equals("huifu"))
{String id=request.getParameter("id");
String huifu=request.getParameter("huifu");
Statement stmt_ad=conn.createStatement();
String Sql="update book set huifu='"+huifu+"' where id="+ id;
int shan=stmt_ad.executeUpdate(Sql);
stmt_ad.close();
conn.close(); //关闭连接对象
response.sendRedirect("index.jsp");
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -