|
- <%@ language=vbscript codepage="65001" %>
- <!--#include file="conn.asp"-->
- <!--#include file="function.asp"-->
- <%
- Response.Charset = "UTF-8"
-
- function rtn_log(c_my_rtn_str)
- c_my_logpath = "rlog" & year(now()) & right("0" & month(now()),2) & right("0" & day(now()),2) & ".txt"
- makeFile c_my_logpath,c_my_rtn_str
- end function
-
- Sub makeFile(cfilename,cfilecontent)
- on error resume next
-
- filepath=Server.MapPath(cfilename)
- Set fso = Server.CreateObject("Scripting.FileSystemObject")
-
- c_fileoldcontent = ""
- Set txt = fso.OpenTextFile(filepath,1,true)
- c_fileoldcontent = txt.ReadAll
- txt.close
-
- set file = fso.opentextfile(filepath, 2 , TRUE)
- c_filenewcontent = cstr(now()) & "@" & GetIP & " : " & cfilecontent
- c_fileoldcontent = c_fileoldcontent & c_filenewcontent
- file.writeline c_fileoldcontent
- file.close
- set file = nothing
-
- set fso = nothing
- End Sub
-
- Private Function GetUrl()
- Dim ScriptAddress, M_ItemUrl, M_item
- ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME")) '取得当前地址
- M_ItemUrl = Request.QueryString
- cstr1 = trim(ScriptAddress & "?" & M_ItemUrl)
-
- rtn_log cstr1
-
- GetUrl = cstr1
- End Function
-
- strURL = GetUrl
-
- c_code = trim(request("code"))
- c_state = trim(request("state"))
-
- c_url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxadfcc2db38e68fbf&secret=44495dd2477a8cbd213f24b875b6771c&code=" & c_code & "&grant_type=authorization_code"
- 'Set objXML = CreateObject("Microsoft.XMLHTTP")
- 'Set objXML = CreateObject("MSXML2.XMLHTTP")
- Set objXML = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
- objXML.open "GET",c_url,false
- objXML.send
- c_rtn = objXML.responseText
-
- nnum1 = instr(c_rtn,"""openid"":")
- c_openid = ""
- if nnum1-0>0 then
- c_rtn = mid(c_rtn,nnum1+10)
- nnum1 = instr(c_rtn,"""")
- c_openid = left(c_rtn,nnum1-1)
- response.cookies("m_openid") = c_openid
- end if
-
- 'response.write request.cookies("m_openid")
- c_tt = year(now()) & month(now()) & day(now()) & hour(now()) & minute(now()) & second(now())
- c_prodcode = request.cookies("m_prod_code")
- if c_state = "proddetail" then response.redirect "/details.html?prod_code=" & c_prodcode
- if c_state = "proddetail2" then response.redirect "/bookingHomePage/mdidiDetail.html?prod_code=" & c_prodcode
- if c_state = "proddetail3" then response.redirect "/disneyDetail.html?prod_code=" & c_prodcode
- if c_state = "getmyorder" then response.redirect "/my_order.html?tt=" & c_tt
-
- 'response.write c_openid & "<br/>" & c_state
-
- %>
|