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

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
LVL 8
AJAY CHADHAAsked:
Who is Participating?
 
AzraSoundConnect With a Mentor Commented:
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
 
AJAY CHADHAAuthor Commented:
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
 
AzraSoundCommented:
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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
BerCommented:
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
 
AJAY CHADHAAuthor Commented:
So, Azra.

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

Ajay Chadha
0
 
AzraSoundCommented:
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
 
AJAY CHADHAAuthor Commented:
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
 
AJAY CHADHAAuthor Commented:
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
 
AJAY CHADHAAuthor Commented:
Helo, You there..??
0
 
AzraSoundCommented:
>>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
 
AJAY CHADHAAuthor Commented:
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
 
AzraSoundCommented:
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
 
AJAY CHADHAAuthor Commented:
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
 
AJAY CHADHAAuthor Commented:
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
 
AJAY CHADHAAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.