Guest User

Untitled

a guest
Jun 14th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <!-- #INCLUDE file="inc/settings.asp" -->
  3. <!-- #INCLUDE file="inc/functions.asp" -->
  4. <!-- #INCLUDE file="inc/db_connect.asp" -->
  5. <%
  6. nameSurname = sqlquote(trim(request.form("name"))) & ""
  7. comment = sqlquote(trim(request.form("comment")) & "")
  8. nid = request.form("nid")
  9. pid = request.form("pid")
  10. comment_date = DatePart("d",now()) & "/" & DatePart("m",now()) & "/" & DatePart("yyyy",now())
  11.  
  12. if vercode = "1234" then
  13. if nameSurname = "" then nameSurname = "Anonymous" end if
  14. if comment <> "" then
  15. strSQL = "INSERT INTO Comments (fName, Comment, DateSubmitted, NewsID) " &_
  16. "VALUES ('" & nameSurname & "', '" & comment & "', #" & comment_date & "#, " & nid & ");"
  17. con.execute strSQL
  18. con.close
  19. end if
  20. response.redirect("news.asp?NewsID=" & encrypt(nid) & "&PID=" & encrypt(pid) )
  21. %>
  22.  
  23. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  24. <!-- #INCLUDE file="inc/settings.asp" -->
  25. <!-- #INCLUDE file="inc/functions.asp" -->
  26. <!-- #INCLUDE file="inc/db_connect.asp" -->
  27. <%
  28. nameSurname = sqlquote(trim(request.form("name"))) & ""
  29. comment = sqlquote(trim(request.form("comment")) & "")
  30. nid = request.form("nid")
  31. pid = request.form("pid")
  32. comment_date = DatePart("d",now()) & "/" & DatePart("m",now()) & "/" & DatePart("yyyy",now())
  33.  
  34. if vercode = "1234" then
  35. if nameSurname = "" then
  36. nameSurname = "Anonymous"
  37. end if
  38. if comment <> "" then
  39. strSQL = "INSERT INTO Comments (fName, Comment, DateSubmitted, NewsID) " &_
  40. "VALUES ('" & nameSurname & "', '" & comment & "', #" & comment_date & "#, " & nid & ");"
  41. 'debugging strsql
  42. con.execute strSQL
  43. con.close
  44. end if
  45. response.redirect("news.asp?NewsID=" & encrypt(nid) & "&PID=" & encrypt(pid) )
  46. end if
  47. %>
Add Comment
Please, Sign In to add comment