Delete and Update Permissions
Okay so I have a page that I can pull information from my database and show it on the page. I have a page to post to the database. I also have links under the information for delete and update. The only problem is...I don't want anyone that isn't authenticated to delete or update. Here is the view page with the delete and update links.
-------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<body bgcolor="black" text="red">
<p><center>For officers that would like to submit news, please <a href="Link to adding to the database that shows on this page.">login</a></center>
<center>Officers can add other officers by clicking <a href="Link to adding a different item">here</a></center></p>
<%
Dim adoCon
Dim rs
Dim strSQL
set adoCon=Server.CreateObject("ADODB.Connection")
adoCon.Provider="Microsoft.Jet.OLEDB.4.0"
adoCon.Open "My Database Connection"
set rs = Server.CreateObject("ADODB.recordset")
strSQL="SELECT News.* FROM News ORDER BY Date DESC;"
rs.Open strSQL, adoCon
%>
<%do until rs.EOF%>
<%for x=0 to 1 %>
<%Response.Write(rs.fields (x).value)%><br>
<%next
Response.Write("<a href=""delete.asp?News=" & rs("NewsID") & """>")
Response.Write("Delete")
Response.Write("</a> ")
Response.Write ("<a href=""updateform.asp?News=" & rs("NewsID") & """>")
Response.Write ("Update")
Response.Write ("</a><br><br>")
rs.MoveNext%>
<%loop
rs.close
adoCon.close
%>
</table></body>
</html>
|