| |
carmichaelscott
Posts: 2
Score: 0
Joined: 11/18/2007
Status: offline
|
Hi, I'm having a really weird problem with some code and hoping for a little help/ideas. Just to explain what's going on briefly... I've added an include to the top of all files on our site (this code is pasted below) to check IP address, and then some pages will display slightly different content for our Canadian or US customers. This works fine in Firefox. However, in IE, when a Canadian visitor comes it doesn't display canadian content on the http version of any page. Once they go to a https page, it works just fine. After that, if they go back to an http page it still displays properly. The code is as follows: ----------------------------------------------------------------- customerCountry = Session("CustomerCountry") IF CustomerCountry = "" OR CustomerCountry = null THEN Dim connIPIP ' ADO connIPection Dim rstIP Dim strDBPathIP ' path to our Access database (*.mdb) file Dim queryIP strDBPathIP = Server.MapPath("/Database/ipcountry.mdb") Set connIP = Server.CreateObject("ADODB.connection") connIP.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPathIP & ";" ip=request.servervariables("REMOTE_ADDR") myIP=split(ip,".") IPnumber=(myIp(0)*16777216)+(myIP(1)*65536)+(myIP(2)*256)+(myIP(3)) queryIP="Select * from Countries Where IP_FROM<=" & IPnumber & " AND IP_TO>=" & IPnumber & ";" Set rstIP = connIP.Execute(queryIP) IF NOT rstIP.EOF THEN IF rstIP("COUNTRY_CODE2") = "CA" THEN customerCountry = "CA" ELSE customerCountry = "US" END IF Session("CustomerCountry") = customerCountry END IF rstIP.close set rstIP = nothing connIP.close set connIP = nothing END IF ----------------------------------------------------------------- Any ideas as to why this might happen? Thanks in advance, Scott
|
|