Solved

Simple But Can't figure out why..??

Posted on 2002-04-17
15
142 Views
Last Modified: 2010-05-02
Here is part of my code

' in global area
Dim IE As InternetExplorer

' in Button_click
Dim FinalURL as String

FinalURL="http://click.linksynergy.com/fs-bin/click?id=DxNgWmclqaE&offerid=24474.10001206&type=3&subid=0"

IE.Navigate FinalURL, ,"_top"

But when this code executes, the Internet Exporer opens

http://click.linksynergy.com/fs-bin/swat?lsnsig=fHCYhkMt9U0&id=dxngwmclqae&offerid=24474.10001206&type=3&subid=0

instead of

http://click.linksynergy.com/fs-bin/click?id=DxNgWmclqaE&offerid=24474.10001206&type=3&subid=0

So, we can see that "/click?" automatically gets converted to "/swat?lsnsig=fHCYhkMt9U0&"

I can't figure out why..??

Do you know..!!

Ajay Chadha
0
Comment
Question by:AJAY CHADHA
  • 9
  • 5
15 Comments
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6948892
This time, it got converted to

http://click.linksynergy.com/fs-bin/swat?lsnsig=lX%2Bcgoj1yuE&id=dxngwmclqae&offerid=24474.10001206&type=3&subid=0

Can you figure out what the problem can be..!!

Ajay Chadha
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6949267
Good chance it is just server side code.  It may be checking certain Session variables, etc, and based on that, redirecting you to a different URL (w/ new query string values)
0
 
LVL 2

Expert Comment

by:Ber
ID: 6949398
as AzraSound said this is a server side Re-Direct if you click on one of your links above again you will find that they do not bring you to the same links..
for example...

When I clicked on this URL
http://click.linksynergy.com/fs-bin/click?id=DxNgWmclqaE&offerid=24474.10001206&type=3&subid=0

I got re-directed to this which again is not listed above...
http://www.hotwire.com/cars.jsp?siteID=DxNgWmclqaE-057yvCe1Aro6tXsTT8bASA

Cheers...
Ber...



0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6949609
So, Azra.

What can be a solution to this problem..???

Ajay Chadha
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6949614
Nothing...unless you can figure out EXACTLY what their server side code is doing...and I highly doubt click.linksynergy.com is going to hand that over to you.   :-)

Unless, maybe, you can figure out how you got to that link normally via their website, and walk through those steps manually via code (like auto browsing with the instance of IE you create)
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6951410
So, is there any other way to open a url like that..??

When you do it manually, then it works fine but when you do it via code then it doesn't work..!!

Azra, Please I know you can do it. VB has not kicked our butts yet..!!

Ajay Chadha
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6951412
Also, I have one more question open. Maybe you can help with it as well..!

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?qid=20289312
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6953247
Helo, You there..??
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6953398
>>When you do it manually, then it works fine but when you do it via code then it doesn't work..!!

Exactly how did you do it manually?  Did you login first?  Come from some sort of home page?  Whatever steps you took to do it manually...you need to try and reproduce via code (visit the same pages, in the same order, etc...)
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6956557
Azra, I am not doing the things like login and etc. See, it is a simple url and i have some more urls like this. But all of them give error when used with IE.Navigate
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6957192
Something must be different from when you are going there manually, as if you were just browsing their site, versus what you are doing with the webbrowser control.  If you were to simply go to that site to get to the URL you are trying to get to, what do you do?  For example, if I try and just click on that link you are trying to navigate to, I get redirected...more than likely because I am a new user.  You MUST know what is needed to get to that link directly.  It may be that the server side code checks from what URL you came from, and if it isnt specifically one they want you to be coming from, they redirect you.  This is NOT a limitation of VB, but rather, of the lack of control you have over what the web programmers of that site have implemented.
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6957366
Hello Azra,

You point may be correct but I don't think that it is the case here.

You can visit that url as many times as you want manually but when try to vist it from ie.navigate then the problem occurs.

And this is not the case with every IE.navigate

I made another code and oit works fine there... What is the point in between..??
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6957613
Hello Azra, I figured that out.

Basically it was my own fault. Here is what i was doing

Dim FinalURL as String

FinalURL=Lcase("http://click.linksynergy.com/fs-bin/click?id=DxNgWmclqaE&offerid=24474.10001206&type=3&subid=0")

IE.Navigate FinalURL, ,"_top"

So, it was due to the lcase..!! When i tried to do it without lase then it worked like a charm..!!

So, what do think we should do with this thread. I think I must divide the points between you and Ber ...

Is that ok wit you.??

Ajay Chadha
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 100 total points
ID: 6958252
That would be fine...though, I still say that navigating to URLs based on query strings that correspond to some unknown server side code is dangerous, and you will never know when the site developers decide to alter their code in the future (which makes your application difficult to maintain for customers if this is something that will be used for some time)
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6959427
Ok Azra, I'll take care of it. BTW, Your suggestions were really helpful. So, I decided to giev pts to you ..

Thanx once again man..!!

Ajay Chadha
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question