Re: Getting the referer info into a form field?
- From: "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 10:15:56 -0400
Hi Edwin,
That would probably require some server-side programming to do right (or at
least easily), unless you put the same JavaScript into every page that
conditionally stored the referer in a Cookie, only if the referer was not
from the same domain, and if the Cookie did not exist already (which would
indicate that the user had navigated to a previous page from the different
domain, and therefore would not need to be reset). Using client-side
JavaScript alone, though, nice thinking - yes, a Cookie would be the way to
go. You would NOT want to set the Cookie's expiration. A Cookie without an
expiration expires at the end of the current User Session.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
"Edwin Hannan" <edwin.hannan_AT_NOSPAM_ntlworld.com> wrote in message
news:Ot7didLTFHA.2424@xxxxxxxxxxxxxxxxxxxxxxx
> Kevin
>
> Thanks for that.
>
> I take your point on a visitor perhaps going to the home page first then
> linking to the form, that could happen, would I use a session cookie to
> store the referrer value?, If so what is the best code for this? (new to
> cookies..been reading up on them:-)
>
> Cheers
>
> Ed
>
> --
> Edwin Hannan
> edwin.hannan@xxxxxxxxxxxx
> "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:ucGPBQLTFHA.2676@xxxxxxxxxxxxxxxxxxxxxxx
>> You are aware that the referrer refers to the last PAGE visited, not the
>> last domain, right? So, if they come to the page from a page inside your
>> web, it will be the last page inside your web that they viewed.
>>
>> That said, and assuming that people are linking from other sites directly
> to
>> your form, you can use JavaScript to do this. It is the document.referer
>> property. Example:
>>
>> <script type="text/javascript"><!--
>> document.forms[0].TextBox1.value = document.referer;
>> //--></script>
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> What You Seek Is What You Get.
>>
>> "Edwin Hannan" <edwin.hannan_AT_NOSPAM_ntlworld.com> wrote in message
>> news:%23iPhBLKTFHA.3140@xxxxxxxxxxxxxxxxxxxxxxx
>> > Hi
>> >
>> > uising FP 2000
>> >
>> >
>> > I want to know where my email enquiries (form results from an online
>> > app
>> > form) have come form e.g fish4, wannadoo etc so when I print them off
>> > it
>> > shows the name of the referer.
>> >
>> > Can any one help
>> >
>> > cheers
>> >
>> > --
>> > Edwin Hannan
>> > edwin.hannan@xxxxxxxxxxxx
>> >
>> >
>>
>>
>
>
.
- Follow-Ups:
- Re: Getting the referer info into a form field?
- From: Edwin Hannan
- Re: Getting the referer info into a form field?
- References:
- Getting the referer info into a form field?
- From: Edwin Hannan
- Re: Getting the referer info into a form field?
- From: Kevin Spencer
- Re: Getting the referer info into a form field?
- From: Edwin Hannan
- Getting the referer info into a form field?
- Prev by Date: Re: Searching
- Next by Date: Re: Searching
- Previous by thread: Re: Getting the referer info into a form field?
- Next by thread: Re: Getting the referer info into a form field?
- Index(es):
Relevant Pages
|