【JSP开源代码栏目提醒】:网学会员为需要JSP开源代码的朋友们搜集整理了fav_del.jsp相关资料,希望对各位网友有所帮助!
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GB18030" import="java.sql.*,java.util.*"%>
<%@ include file="config.ini"%>
<%@ include file="conn.jsp"%>
<%@ include file="readlogin.jsp"%>
<%
String id=request.getParameter("id");
String action=null;
if(id==null)
{
out.print("<script>");
out.print("alert('id错误');");
out.print("location.href='fav.jsp';");
out.print("</script>");
}
%>
<%
try{
action=request.getParameter("action");
if(action.equals("del"))
{
try
{
sqlstr="delete from fav where id="+id;
iCanDb.doDelete(sqlstr);
out.print("<script>");
out.print("alert('删除成功!');");
out.print("location.href='fav.jsp';");
out.print("</script>");
}
catch(Exception e)
{
out.print("<script>");
out.print("alert('数据库出错!');");
out.print("location.href='fav.jsp';");
out.print("</script>");
}
}
if(action.equals("confirm"))
{
try
{
sqlstr="select title from fav where id="+id;
rs=iCanDb.doSelect(sqlstr);
rs.next();
%>
<html>
<head>
<%@ include file="head.jsp"%>
</head>
<body>
<center>
<table border="0" width="768" id="table1" cellspacing="0" cellpadding="0">
<tr>
<%@ include file="top.jsp"%>
</tr>
<tr>
<td width="90" valign="top">
<%@ include file="menu.jsp"%> </td>
<td width="588" valign="top"><center>
<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="1" width="588" id="table4" bordercolorlight="#0A9EE4" cellspacing="0" cellpadding="5" bordercolordark="#0A9EE4">
<tr>
<td>
<table border="0" width="100%" id="table5" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" id="table6" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom" width="50%">
</td>
<td width="50%">
<img src="images/n-fav.jpg" align="right" width="230" height="70"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><hr noshade color="#0A9EE4" size="1"></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><center><table border="0" width="450" id="table2" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="450" id="table2" cellspacing="0" cellpadding="0"><tr>
<td height="25" align="left" valign="middle" background="images/tdbg1.gif">
<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">
<tr>
<td>
<p align="center">
<b><font size="2" color="#FFFFFF">删除收藏</font></b></td>
</tr>
</table>
</td></tr></table></td>
</tr>
<tr>
<td>
<table border="1" width="100%" id="table4" bordercolor="#156FC7" style="border-collapse: collapse" cellpadding="3" cellspacing="0" height="150">
<tr>
<td width="97%" align="center" height="38">
<font size="2" color="#156FC7">确认删除下面的收藏?</font></td>
</tr>
<tr>
<td width="97%" height="53">
<p align="center"><font size="2" color="#156FC7"><%=rs.getString("title")%></font></td>
</tr>
<tr>
<td>
<p align="center">
<input type="button" value="提交" name="B1" style="border: 1px solid #156FC7" onclick="javascript:location.href='fav_del.jsp?action=del&id=<%=id%>';">
<input type="button" value="返回" name="B2" style="border: 1px solid #156FC7" onclick="javascript:location.href='fav.jsp';"></td>
</tr>
</table>
</center></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td height="16">
<p style="line-height: 150%">
</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="90"></td>
</tr>
<tr>
<td width="90" valign="top">
</td>
<td width="588" valign="top">
<%@ include file="copyright.jsp"%>
</td>
<td width="90"></td>
</tr>
</table>
<p>
</center>
</p>
</body>
</html>
<%
}
catch(Exception e)
{
out.print("<script>");
out.print("alert('数据库出错');");
out.print("location.href='fav.jsp';");
out.print("</script>");
}
}
else
{
out.print("<script>");