In web development the CGI-variable
HTTP_Referer provide information form which web page a user came to the
current web page. For a feedback database where users could leave comments
about a certain web page this information is existential.
To access the HTTP_Referer in Lotus
Domino you only need a field with the same name in form. The first idea
is to just make this field "Computed when composed". But this
one falls short.
When the feedback document is opened
in the browser the field HTTP_Referer contains the URL from the web page
the user came from. But before the Domino Server saves the document he
recalculates the field HTTP_Referer. So the document in the database only
has the URL of the feedback document but not the URL of the original web
page.
There is quite a simple solution for
this problem. I added a new field "Page" to the form. The field
is "Computed when composed" with a formula referring to itself
and it is hidden while in edit mode.
Instead of the field a computed text
with Pass-thru HTML is visible in edit mode with the following formula.
"<input name=\"Page\"
value=\"" + HTTP_Referer + "\" readonly >"
When the Domino Server generates the
HTML for the feedback web page the field HTTP_Referer contains the URL
of the original web page. The computed text writes the value as a hidden
input with the same name as the field to the HTML. When the user hits the
submit button the value will be transferred to the Domino Server together
with all the other fields. While the Domino Server saves the document there
is no need to recalculate the value.