Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specify custom HTTP Referrer URL

Status
Not open for further replies.

mur3x

MIS
Sep 8, 2003
31
LK
Specify custom HTTP Referrer URL

Hi!.My downloader program requires the above functionality. In other words, when selected a file from a site the users have the option of specifying a Custom referrer URL. (useful on some sites that provides you access to certain files only if you clicked from a download page or from another server etc...). Infact most new Offline browsers support this.(Teleport pro 1.29, Metaproducts OE pro 2.9 etc..)

so How do i send a Custom referrer using VB??...is it possible using winsock?.
help much appreciated..

thnx!
Mur.
 
Hi

You can always communicate with a web server programmatically. However you will need to understand what parameters it expects you to provide. Are you familiar with GET and POST?

GET encodes form data in the url – POST hides form data from view.

We use a product, which is free, called proxomitron ( )

It will let you see information your browser is sending and receiving from the host.

Let me know if you need more information.

david
 
thnx david for ur reply...anyways the below code
shows how to send a fake/custom referrer (mysite.com)
along with the usual HTTP headers.


Code:
Private Sub cmdConnect_Click()

Winsock1.Close
Winsock1.Connect "[URL unfurl="true"]www.brinkster.com",[/URL] "80"

End Sub


Private Sub Winsock1_Connect()
    Dim strCommand As String
    strCommand = "POST [URL unfurl="true"]http://www24.brinkster.com/mur3/referrer.asp"[/URL] & " HTTP/1.0" & vbCrLf
    strCommand = strCommand & "Accept: */*" & vbCrLf
    strCommand = strCommand & "Accept: text/html" & vbCrLf
    strCommand = strCommand & "Referer:  [URL unfurl="true"]http://www.mysite.com"[/URL] & vbCrLf
    strCommand = strCommand & "Content-Type:  application/x-[URL unfurl="true"]www-form-urlencoded"[/URL] & vbCrLf
    strCommand = strCommand & vbCrLf
    Winsock1.SendData strCommand
End Sub


Note : ' is an ASP page which outputs the HTTP_Referrer, i.e. it tells where you came from..
In this case it'll show 'you came from

So for testing purposes i want to invoke the users default browser with the page ' loaded along with the header data sent..

is it possible?? then how to achieve it?..
help much appreciated..

thanks!
Mur.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top