Referring URL

B

BernieH

This is probably an embarrasingly basic question ...

I have a form which gets emailed via a CGI script. I'm trying to grab the
URL of the page on which users clicked this form.

This is part of the form's html -

<FORM action="http://www.myaddress.com/cgibin/forms.cgi" method="post">
<INPUT type="hidden" name=".to_address" value="(e-mail address removed)">
<INPUT type="hidden" name=".email_subject" value="Submit form">

I'm guessing I need a new line such as

<INPUT type="hidden" name="referringURL" value="xxxxx">

It's the "xxxxx" bit which I'm not sure how to fill in.

TIA

bernieh
 
S

Safalra

BernieH said:
I have a form which gets emailed via a CGI script. I'm trying to grab the
URL of the page on which users clicked this form.
This is part of the form's html -
[snip]
I'm guessing I need a new line such as
<INPUT type="hidden" name="referringURL" value="xxxxx">
It's the "xxxxx" bit which I'm not sure how to fill in.

If your host supports server-side includes (SSI), you can use the
following:

<input type="hidden" name="referringURL" value="<!--#echo
var="HTTP_REFERER"-->">

The <!--#echo var="HTTP_REFERER"--> will be replaced with the referer
(if one was specified). On the default configuration of most servers,
you'll need to rename the form's HTML file so it has the extension
'.shtml' rather than '.html' to get this to work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top