Ver Mensaje Individual
  #11 (permalink)  
Antiguo 08/06/2004, 18:46
Avatar de CHuLoSoY
CHuLoSoY
 
Fecha de Ingreso: febrero-2002
Ubicación: Ribeira (Galicia)
Mensajes: 1.900
Antigüedad: 23 años, 2 meses
Puntos: 29
modresp.asp
Moderación de respuestas (eliminar, únicamente)

Código:
<head>
<title>Borrar respuestas</title>
<link rel="stylesheet" type="text/css" href="../../estilo.css">
</head>
<body bgcolor="#66CCFF" topmargin="7" leftmargin="7">
<table border="0" width="100%" style="background-color: #FFFFFF; border: 1 outset #3399FF" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><font size="3"><i><b>Moderación de respuestas</b></i></font><%
id=request.querystring("id")

if request.querystring("mod")="" and request.querystring("borrar")="" then

Set Coneximon = Server.CreateObject("ADODB.Connection")
Set RSs=Server.CreateObject("ADODB.Recordset")
Coneximon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("foros.mdb")&";"
sql = "SELECT * FROM respuestas where idrespuesta="&id
RSs.Open sql, Coneximon, 3,3

asunto=RSs("asunto")

RSs.close
coneximon.close
%>

<br>Quieres borrar la respuesta nº <%=id%> con título <i><font color=red><%=asunto%></font></i>.
<br><br>¿Estás seguro de querer borrar esta respuesta? <a href="modresp.asp?id=<%=id%>&mod=si">Si</a> - <a href="javascript:window.close()">No</a>

<%
elseif request.querystring("mod")="si" then
%>

<br>¿Cuál es el motivo de querer borrar esa respuesta? El motivo y el mensaje quedará grabado hasta que lo revise el webmaster, quien si considera oportuno restituirá el mensaje a su sitio. Intenta ser objetivo al borrar respuestas.
<form action="modresp.asp?id=<%=id%>&borrar=si" method=post>
Motivo: <input type="text" style="font-family: Verdana; font-size: 8pt; border-style: solid; border-width: 1" name="motivo" size="30"><br>
Password: <input type="password" name="pass" style="font-family: Verdana; font-size: 8pt; border-style: solid; border-width: 1" size="10">
&nbsp;<input type="submit" value="Borrar" style="font-family: Verdana; font-size: 8pt; border: 1 outset #0000FF">
</form>

<%
elseif request.querystring("borrar")="si" then

if request.form("pass")="PASSWORD" then

	if request.form("motivo")="Soy webmaster" then

	Set oConn = Server.CreateObject("ADODB.Connection") 

	oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&Server.MapPath("foros.mdb")&";" 

	strSQL ="DELETE * FROM respuestas where idrespuesta="&id 
	oConn.Execute(strSQL) 
	oConn.Close 
	set oConn = nothing 

	else

	Set Conexion = Server.CreateObject("ADODB.Connection")
	Set Rs=Server.CreateObject("ADODB.Recordset")
	Conexion.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("foros.mdb")&";"
	sql = "SELECT * FROM respuestas where idrespuesta="&id&";"
	Rs.Open sql, Conexion, 3,3

	asunto=Rs("asunto")
	mensaje=rs("mensaje")
	nombre=rs("nombre")
	fecha=rs("modificado")
	idmsg=rs("idmensaje")

	Rs.close
	conexion.close

	Set Con = Server.CreateObject("ADODB.Connection")
	Set Res=Server.CreateObject("ADODB.Recordset")
	Con.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("foros.mdb")&";"
	sql = "SELECT * FROM borrados"
	Res.Open sql, Con, 3,3

	res.addnew
	res("asunto")=asunto
	res("mensaje")=mensaje
	res("nombre")=nombre
	res("fechaorde")=fecha
	res("idmsg")=idmsg
	res("motivo")=request.form("motivo")
	res("fechaborra")=now()
	res.update

	res.close
	con.close

	Set oConn = Server.CreateObject("ADODB.Connection") 

	oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&Server.MapPath("foros.mdb")&";" 

	strSQL ="DELETE * FROM respuestas where idrespuesta="&id 
	oConn.Execute(strSQL) 
	oConn.Close 
	set oConn = nothing 
end if

%>
<br><br><b>Respuesta borrada con éxito.</b>
<%else
%><br><br><b>Password incorrecta.</b>
<%end if%>
<%end if%>

</td></tr>
</table>
__________________
ESQUIO Dominios y Hosting
Las mejores características con los mejores precios.