🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
7 messages
7 total messages Started by Phil Mon, 28 Nov 2005 05:31
Getting Reffering Url
#894
Author: Phil
Date: Mon, 28 Nov 2005 05:31
17 lines
1026 bytes

How can I get the URL of the referring page 
in my cgi-executable:

I have 
void __fastcall TWebModule1::WebModule1Action1(
      TObject *Sender, TWebRequest *Request, TWebResponse *Response,
      bool &Handled)
{

         AnsiString wherefrom = Request->URL;
  
         ... 
}

but wherefrom is empty.
Re: Getting Reffering Url
#895
Author: Phil
Date: Mon, 28 Nov 2005 06:33
28 lines
1384 bytes
"Phil" <nospam@nospam.net> wrote:
>
>
>How can I get the URL of the referring page 
>in my cgi-executable:
>
>I have 
>void __fastcall TWebModule1::WebModule1Action1(
>      TObject *Sender, TWebRequest *Request, TWebResponse *Response,
>      bool &Handled)
>{
>
>         AnsiString wherefrom = Request->URL;
>  
>         ... 
>}
>
>but wherefrom is empty.

Actually I should have had 
AnsiString wherefrom = Request->Referer;

But this too is an empty string.

Thank you,

Phil
Re: Getting Reffering Url
#896
Author: Charlie Potts
Date: Mon, 28 Nov 2005 09:47
13 lines
1146 bytes
>>
>>but wherefrom is empty.
>
>Actually I should have had 
>AnsiString wherefrom = Request->Referer;
>
>But this too is an empty string.
>

I am having the same problem.  

Anyone know what is the solution please?
Re: Getting Reffering Url
#902
Author: Hans Galema
Date: Wed, 30 Nov 2005 16:17
19 lines
1513 bytes
Phil wrote:

> AnsiString wherefrom = Request->Referer;
> 
> But this too is an empty string.

If Indy does not implement that you can query the environment variable
yourself.

What I use in a cgi.exe is:

     if ( getenv ( "HTTP_REFERER" ) )
	printf ( "HTTP_REFERER: %s<br>\n", getenv ( "HTTP_REFERER" )  );

Of course you could sprintf that to a buffer or use AnsiString().printf().

Please report if this does the job.

Hans.
Re: Getting Reffering Url
#908
Author: Phil
Date: Sun, 04 Dec 2005 11:19
27 lines
1529 bytes
Hans Galema <notused@notused.nl> wrote:
>Phil wrote:
>
>> AnsiString wherefrom = Request->Referer;
>> 
>> But this too is an empty string.
>
>If Indy does not implement that you can query the environment variable
>yourself.
>
>What I use in a cgi.exe is:
>
>     if ( getenv ( "HTTP_REFERER" ) )
>	printf ( "HTTP_REFERER: %s<br>\n", getenv ( "HTTP_REFERER" )  );
>
>Of course you could sprintf that to a buffer or use AnsiString().printf().
>
>Please report if this does the job.
>
>Hans.

I used:

AnsiString hans = getenv ("HTTP_REFERER");

and it was empty. 
Re: Getting Reffering Url
#909
Author: Phil
Date: Sun, 04 Dec 2005 11:21
24 lines
1605 bytes
Hans Galema <notused@notused.nl> wrote:
>Phil wrote:
>
>> AnsiString wherefrom = Request->Referer;
>> 
>> But this too is an empty string.
>
>If Indy does not implement that you can query the environment variable
>yourself.
>
>What I use in a cgi.exe is:
>
>     if ( getenv ( "HTTP_REFERER" ) )
>	printf ( "HTTP_REFERER: %s<br>\n", getenv ( "HTTP_REFERER" )  );
>
>Of course you could sprintf that to a buffer or use AnsiString().printf().
>
>Please report if this does the job.
>
>Hans.


I am not using Indy BTW.  Using the example project.  Do you ALWAYS get this with Indy?  Thanks...
Re: Getting Reffering Url
#794
Author: Mark Jacobs
Date: Tue, 31 Jan 2006 11:03
14 lines
1479 bytes
>>>but wherefrom is empty.
>>
>>Actually I should have had 
>>AnsiString wherefrom = Request->Referer;
>>But this too is an empty string.
>>
> I am having the same problem.  
> Anyone know what is the solution please?

I've got the same problem. Referer is always empty, so I can only conclude that it was a 
deliberate omission to stop people writing website tracking programs using BCB.
-- 
Mark Jacobs
http://www.dkcomputing.co.uk
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads