You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

77 lines
2.5 KiB

  1. <%@ language=vbscript codepage="65001" %>
  2. <!--#include file="conn.asp"-->
  3. <!--#include file="function.asp"-->
  4. <%
  5. Response.Charset = "UTF-8"
  6. function rtn_log(c_my_rtn_str)
  7. c_my_logpath = "rlog" & year(now()) & right("0" & month(now()),2) & right("0" & day(now()),2) & ".txt"
  8. makeFile c_my_logpath,c_my_rtn_str
  9. end function
  10. Sub makeFile(cfilename,cfilecontent)
  11. on error resume next
  12. filepath=Server.MapPath(cfilename)
  13. Set fso = Server.CreateObject("Scripting.FileSystemObject")
  14. c_fileoldcontent = ""
  15. Set txt = fso.OpenTextFile(filepath,1,true)
  16. c_fileoldcontent = txt.ReadAll
  17. txt.close
  18. set file = fso.opentextfile(filepath, 2 , TRUE)
  19. c_filenewcontent = cstr(now()) & "@" & GetIP & " : " & cfilecontent
  20. c_fileoldcontent = c_fileoldcontent & c_filenewcontent
  21. file.writeline c_fileoldcontent
  22. file.close
  23. set file = nothing
  24. set fso = nothing
  25. End Sub
  26. Private Function GetUrl()
  27. Dim ScriptAddress, M_ItemUrl, M_item
  28. ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME")) '取得当前地址
  29. M_ItemUrl = Request.QueryString
  30. cstr1 = trim(ScriptAddress & "?" & M_ItemUrl)
  31. rtn_log cstr1
  32. GetUrl = cstr1
  33. End Function
  34. strURL = GetUrl
  35. c_code = trim(request("code"))
  36. c_state = trim(request("state"))
  37. c_url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxadfcc2db38e68fbf&secret=44495dd2477a8cbd213f24b875b6771c&code=" & c_code & "&grant_type=authorization_code"
  38. 'Set objXML = CreateObject("Microsoft.XMLHTTP")
  39. 'Set objXML = CreateObject("MSXML2.XMLHTTP")
  40. Set objXML = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
  41. objXML.open "GET",c_url,false
  42. objXML.send
  43. c_rtn = objXML.responseText
  44. nnum1 = instr(c_rtn,"""openid"":")
  45. c_openid = ""
  46. if nnum1-0>0 then
  47. c_rtn = mid(c_rtn,nnum1+10)
  48. nnum1 = instr(c_rtn,"""")
  49. c_openid = left(c_rtn,nnum1-1)
  50. response.cookies("m_openid") = c_openid
  51. end if
  52. 'response.write request.cookies("m_openid")
  53. c_tt = year(now()) & month(now()) & day(now()) & hour(now()) & minute(now()) & second(now())
  54. c_prodcode = request.cookies("m_prod_code")
  55. if c_state = "proddetail" then response.redirect "/details.html?prod_code=" & c_prodcode
  56. if c_state = "proddetail2" then response.redirect "/bookingHomePage/mdidiDetail.html?prod_code=" & c_prodcode
  57. if c_state = "proddetail3" then response.redirect "/disneyDetail.html?prod_code=" & c_prodcode
  58. if c_state = "getmyorder" then response.redirect "/my_order.html?tt=" & c_tt
  59. 'response.write c_openid & "<br/>" & c_state
  60. %>