Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


code works on IE https but not http?

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,53637
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> code works on IE https but not http?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 code works on IE https but not http? - 11/18/2007 10:50:11 AM   
  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
 
 
Post #: 1
 
 RE: code works on IE https but not http? - 11/21/2007 2:36:17 AM   
  webber123456

 

Posts: 37
Score: 0
Joined: 9/20/2007
Status: offline
If the code works in forefox then it is not a coding problem,   it is a browser problem indicating the problem is not with code running on the server (ASP).

Since you are using the session object make sure both browsers have cookies enabled.

This may also help

http://support.microsoft.com/kb/274149

< Message edited by webber123456 -- 11/21/2007 2:44:16 AM >

(in reply to carmichaelscott)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> code works on IE https but not http? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts