Thread View: borland.public.cppbuilder.internet.web
7 messages
7 total messages
Started by Phil
Mon, 28 Nov 2005 05:31
Getting Reffering Url
Author: Phil
Date: Mon, 28 Nov 2005 05:31
Date: Mon, 28 Nov 2005 05:31
17 lines
1026 bytes
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
Author: Phil
Date: Mon, 28 Nov 2005 06:33
Date: Mon, 28 Nov 2005 06:33
28 lines
1384 bytes
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
Author: Charlie Potts
Date: Mon, 28 Nov 2005 09:47
Date: Mon, 28 Nov 2005 09:47
13 lines
1146 bytes
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
Author: Hans Galema
Date: Wed, 30 Nov 2005 16:17
Date: Wed, 30 Nov 2005 16:17
19 lines
1513 bytes
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
Author: Phil
Date: Sun, 04 Dec 2005 11:19
Date: Sun, 04 Dec 2005 11:19
27 lines
1529 bytes
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
Author: Phil
Date: Sun, 04 Dec 2005 11:21
Date: Sun, 04 Dec 2005 11:21
24 lines
1605 bytes
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
Author: Mark Jacobs
Date: Tue, 31 Jan 2006 11:03
Date: Tue, 31 Jan 2006 11:03
14 lines
1479 bytes
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