?
Solved

IE Referer?

Posted on 2004-04-30
18
Medium Priority
?
835 Views
Last Modified: 2013-11-13
I want to open a new instance of internet explorer that navigates to a the page I tell it to, and I want to specify the referer... what is the exact code I would need to do this?
0
Comment
Question by:X2Cube
[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
  • 5
  • 4
  • 3
  • +4
18 Comments
 
LVL 6

Expert Comment

by:prasitlee
ID: 10965120
Hi X2Cube,
    What is referer ? Please explain :D
                                                      Meng
0
 
LVL 6

Expert Comment

by:prasitlee
ID: 10965126
Hi X2Cube,
   I am not sure if I am right or not. Try the following code and let me know your comment.


Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

ShellExecute Me.hwnd, "open", "http://www.google.com", vbNullString, "", 0

                                                                   Meng
0
 
LVL 6

Expert Comment

by:prasitlee
ID: 10965141
Hi X2Cube,
    You have to insert "Private" in front of "Declare" statement as following
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

ShellExecute Me.hwnd, "open", "http://www.google.com", vbNullString, "", 0

    Any problem, please let me know.
                                                                 Meng
0
Industry Leaders: 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!

 

Author Comment

by:X2Cube
ID: 10965157
prasitlee I don't think your code specified the referer.

The referer is the website you are coming from, say you go to http://www.google.com and you got there from http://www.yahoo.com. It will tell http://www.google.com that you came from http://www.yahoo.com, this is what I want to specify.

I want to open a window that tells google that I came from yahoo when I really didn't.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10965181
X2Cube, the only way to do this is by using the Winsock Control and sending the headers you want yourself.


-Brian
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10965182
Then you can make it whatever you want :)

-Brian
0
 

Author Comment

by:X2Cube
ID: 10965219
BrianGEFF719 I have seen it done with internet explorer

maybe if I open the page I want the refer to come from but then do a write in on it that redirects to the other page... that might work

I know how to do it in winsock perfectly, I've done it many times before... but now I need to use internet explorer for it
0
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 500 total points
ID: 10965387
Well, here's one way of doing it.  Create a form and drop a WebBrowser control and Command Button on it.  Then insert this code.

Private Sub Command1_Click()
    Dim strHeader As String
    'You can make the URL below anything you want it to be.
    strHeader = "Referer: www.mysite.com"
    'The stie I'm navigating to will show the header.  That way you can see that the proper Referer value was passed.
    WebBrowser1.Navigate2 "http://moneycentral.msn.com/inc/admin/general/httphead.asp", , , , strHeader
End Sub
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10965501
Hmm,

This seems to be a tricky question.

Tell me if I'm right and this is your question:

As an Example:

1: you go to google.com

2:then you  navigate to yahoo.com

3: Now you want when user presses balk button on the browser , it does not go back to
google.com but instead go to a site that you specify(ex:altavista.com) ?






0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10965503
srry for typo
balk button =back button on browser
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10965657
maybe if I open the page I want the refer to come from but then do a write in on it that redirects to the other page
========================================

Yes, history list is not writable, but only readable..
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 10968528
And exactly why do you need to specify the referrer?  Hopefully not for some type of scamming...
0
 

Author Comment

by:X2Cube
ID: 10968546
I know it can be done with the webbrowser control, but I want it to be done with an internet explorer window :(

I don't want the back button thing, I just want it to specify the referer so PHP scripts think I came from a page that I really didn't. And I want an Internet Explorer window to open, going to that page.

I do not want:

Winsock
INET
Webbrowser Control
Anything that isn't Internet Explorer popping up
0
 
LVL 1

Accepted Solution

by:
shaunpud earned 500 total points
ID: 10970173
tested and working perfect
WebBrowser1.Navigate "http://www.domain.com/", , , , "Referer: www.domain.com" & vbCrLf
0
 

Author Comment

by:X2Cube
ID: 10972837
shaunpud

that doesn't open up an internet explorer window, it navigates a webbrowser object...

I do not want the webbrowser object in a form to navigate to the page.... I want a new internet explorer window to open up and navigate to the page.
0
 

Author Comment

by:X2Cube
ID: 10972884
I found how to do it by myself, shaunpud's answer helped a bit.

After looking all the answers over I see that BlueDevilFan had a slightly different answer, but it would've helped also if I had seen it differently.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 10973690
>>that doesn't open up an internet explorer window, it navigates a webbrowser object...

Hopefully you've learned that coding either a webbrower or an IE instance are essentially identical.  Learn to walk before you run...
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10974271
I agree with  AzraSound. I guess you have said no Webbrowser !!!
0

Featured Post

Industry Leaders: 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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

719 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