Guest User

Untitled

a guest
Apr 9th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.80 KB | None | 0 0
  1. <%@ Language=VBScript %>
  2. <!--#include virtual="/silpada2/Connections/connGKCCF.asp" -->
  3. <!--#include virtual="/silpada2/ASP/HOP.asp" -->
  4. <% 'Response.Buffer = True %>
  5. <%
  6.  
  7. //generates merchant_ref_number based on Epoch time
  8. function orderNum()
  9.     Dim Date1, Date2, Epoch
  10.  
  11.     Date1 = "01/01/1970 00:00:00"
  12.  
  13.     Date2 = Now
  14.  
  15.     Epoch = DateDiff("s",Date1,Date2)
  16.    
  17.     orderNum = Epoch
  18.  
  19. end function
  20.  
  21. //grab the form fields
  22. dim firstname, middlename, lastname, phone, email, country, amount, order_number, comments
  23.  
  24. order_number = orderNum()
  25. firstname = server.HTMLEncode(Request.Form("customer_firstname"))
  26. middlename =  server.HTMLEncode(Request.Form("customer_middlename"))
  27. lastname = server.HTMLEncode(Request.Form("customer_lastname"))
  28. phone =  server.HTMLEncode(Request.Form("customer_phone"))
  29. email =  server.HTMLEncode(Request.Form("customer_email"))
  30. country =  server.HTMLEncode(Request.Form("bill_country"))
  31. amount =  server.HTMLEncode(Request.Form("amount")) '
  32. comments = server.HTMLEncode(Request.Form("comments")) '
  33.  
  34. ////////////////////////////////
  35. //insert values into the DB
  36. 'insert transaction into database
  37.  
  38. Set oConnection = CreateObject("ADODB.Connection")
  39. oConnection.Open = MM_connGKCCF_STRING
  40. Set oCommand = CreateObject("ADODB.Command")
  41. Set oCommand.ActiveConnection = oConnection
  42.  
  43. Set oCommand = CreateObject("ADODB.Command")
  44. Set oCommand.ActiveConnection = oConnection
  45.  
  46. dim sql
  47.  
  48. sql = "INSERT INTO tblDonations (comments, amount, customer_firstname, customer_lastname, customer_phone, customer_email, order_number) "
  49. sql = sql & "VALUES ('"& comments &"', '"& amount &"', '"& firstname & "', '"& lastname & "', '"& phone & "', '"& email & "', '" & order_number & "');"
  50.  
  51. Response.write(sql)
  52.  
  53. oCommand.Execute(sql)
  54. oCommand.close
  55. ////////////////////////////////
  56. %>
Add Comment
Please, Sign In to add comment