Solved

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

Posted on 2002-04-17
15
145 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 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