mex
04-08-2004, 03:32 PM
This Page is re-directed from a page for deleting a post from a forum!!! Can anyone pliz modify this so that the user doesn't haf to enter the fields but redirect and delete instantly as soon as it reaches in this page!!!! wihout having to enter the name and password. Thanx
<%
s = request.querystring("s")
p = request.querystring("p")
id = request.querystring("id")
parent = request.querystring("parent")
passwort = request.form("pass")
username = request.form("user")
%>
<head>
<title>Login</title>
</head>
<body bgcolor="#ffffff">
<form method="POST" action="delete_entry.asp?id=<%=id%>&s=<%=s%>&p=<%=p%>&parent=<%=parent%>">
<table border="0" cellpadding="0" cellspacing="0" width="100" bgcolor="#ffffff" align="center">
<tr>
<td width="100%">
<table border="0" cellpadding="2" cellspacing="0" width="200" class="text">
<tr>
<td width="389" bgcolor="#000000" align="center" colspan="2"><b>Login</b></td>
</tr>
<tr>
<td width="20%" bgcolor="#FFFFFF" align="left">User</td>
<td width="80%" bgcolor="#FFFFFF" align="left">
<input type="text" name="user" size="19">
</td>
</tr>
<tr>
<td width="20%" bgcolor="#FFFFFF" align="left">Pass</td>
<td width="80%" bgcolor="#FFFFFF" align="left">
<input type="password" name="pass" size="19"></td>
</tr>
<tr>
<td width="394" bgcolor="#FFFFFF" colspan="2" align="center">
<input type="submit" value="Login" name="delete"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<%
user = "user"
pass = "password"
response.write(parent)
response.write(","&id)
if (passwort = pass) and (username = user) and (request.form("delete") = "Login") and (p="all") then
set db = Server.CreateObject("ADODB.Connection")
connect="Driver={Microsoft Access Driver (*.mdb)}; DBQ="& server.mappath("yell.mdb")
db.Open connect
sql = "delete from postings where id = " & id & " or connected = " & id
db.Execute(sql)
db.Close
set db=Nothing
%>
<script>
opener.location.href="index.asp?s=<%=s%>";
self.close();
</script>
<%
end if
if (passwort = pass) and (username = user) and (request.form("delete") = "Login") and (p="one") then
set db = Server.CreateObject("ADODB.Connection")
connect="Driver={Microsoft Access Driver (*.mdb)}; DBQ="& server.mappath("yell.mdb")
db.Open connect
sql = "delete from postings where id = " & id
db.Execute(sql)
sql = "update postings set replies = replies -1 where id = " & parent
db.Execute(sql)
db.Close
set db=Nothing
%>
<script>
opener.location.reload();
self.close();
</script>
<%
end if
%>
</body></html>
<%
s = request.querystring("s")
p = request.querystring("p")
id = request.querystring("id")
parent = request.querystring("parent")
passwort = request.form("pass")
username = request.form("user")
%>
<head>
<title>Login</title>
</head>
<body bgcolor="#ffffff">
<form method="POST" action="delete_entry.asp?id=<%=id%>&s=<%=s%>&p=<%=p%>&parent=<%=parent%>">
<table border="0" cellpadding="0" cellspacing="0" width="100" bgcolor="#ffffff" align="center">
<tr>
<td width="100%">
<table border="0" cellpadding="2" cellspacing="0" width="200" class="text">
<tr>
<td width="389" bgcolor="#000000" align="center" colspan="2"><b>Login</b></td>
</tr>
<tr>
<td width="20%" bgcolor="#FFFFFF" align="left">User</td>
<td width="80%" bgcolor="#FFFFFF" align="left">
<input type="text" name="user" size="19">
</td>
</tr>
<tr>
<td width="20%" bgcolor="#FFFFFF" align="left">Pass</td>
<td width="80%" bgcolor="#FFFFFF" align="left">
<input type="password" name="pass" size="19"></td>
</tr>
<tr>
<td width="394" bgcolor="#FFFFFF" colspan="2" align="center">
<input type="submit" value="Login" name="delete"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<%
user = "user"
pass = "password"
response.write(parent)
response.write(","&id)
if (passwort = pass) and (username = user) and (request.form("delete") = "Login") and (p="all") then
set db = Server.CreateObject("ADODB.Connection")
connect="Driver={Microsoft Access Driver (*.mdb)}; DBQ="& server.mappath("yell.mdb")
db.Open connect
sql = "delete from postings where id = " & id & " or connected = " & id
db.Execute(sql)
db.Close
set db=Nothing
%>
<script>
opener.location.href="index.asp?s=<%=s%>";
self.close();
</script>
<%
end if
if (passwort = pass) and (username = user) and (request.form("delete") = "Login") and (p="one") then
set db = Server.CreateObject("ADODB.Connection")
connect="Driver={Microsoft Access Driver (*.mdb)}; DBQ="& server.mappath("yell.mdb")
db.Open connect
sql = "delete from postings where id = " & id
db.Execute(sql)
sql = "update postings set replies = replies -1 where id = " & parent
db.Execute(sql)
db.Close
set db=Nothing
%>
<script>
opener.location.reload();
self.close();
</script>
<%
end if
%>
</body></html>