Solved

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

Posted on 2002-04-17
15
139 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now