Guest User

Untitled

a guest
May 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. <!--#include file="includes/includes.inc.asp" -->
  2. <%
  3. 'SetVars("all")
  4. If Request.Form("f_cancel") = "Cancel" Then
  5. Response.Redirect("managecontacts.asp")
  6. End If
  7. If Request.Form("f_submit") = "Yes" Then
  8.  
  9. strSQL = "delete agents where id = " & Request.Querystring("id")
  10. 'Response.Write(strSQL & "<br/>")
  11. objConn.Execute(strSQL)
  12. Response.Redirect("manageagents.asp")
  13. End If
  14. If Request.QueryString("id") = "" Then
  15. Response.Redirect("manageagents.asp")
  16. End If
  17. %>
  18.  
  19. <!--#include file="includes/header.asp" -->
  20.  
  21. <h1>Delete Agent</h1>
  22. <form method="post">
  23.  
  24. <table class="table tall wide" cellspacing="0">
  25. <tr class="bluehead">
  26. <td>id</td>
  27. <td>Email</td>
  28. <td>Full Name</td>
  29.  
  30. </tr>
  31. <%
  32. strSQL = "select * FROM agents where agents.id = " & Request.QueryString("id")
  33. objRS.Open strSQL, objConn
  34. Do While Not objRS.EOF
  35. Response.Write("<tr>")
  36. Response.Write("<td>" & objRS("id") & "</td>")
  37. Response.Write("<td>" & objRS("email") & "</td>")
  38. Response.Write("<td>" & objRS("first_name") &" "& objRS("middle_name") &" "& objRS("last_name") & "</td>")
  39. Response.Write("<input type=""hidden"" value=""" & objRS("id") &""" name=""id"" />" )
  40. Response.Write("</tr>")
  41. objRS.MoveNext
  42. Loop
  43. objRS.Close
  44. %>
  45. <tr>
  46. <td colspan="2">Are you sure you want to delete this agent?</td>
  47. </tr>
  48. <tr>
  49. <td><input type="hidden" name="id" value="<%=Request.QueryString("id") %>" /><input type="submit" name="f_submit" value="Yes" class="button" />&nbsp;
  50. <input type="submit" name="f_cancel" value="Cancel" class="button" /></td>
  51. </tr>
  52. </table>
  53. </form>
  54.  
  55. <!--#include file="includes/footer.asp" -->
Add Comment
Please, Sign In to add comment