Skip to main content
October 21, 2009
Question

cgi.http_referer

  • October 21, 2009
  • 1 reply
  • 1972 views

In the beginning of each template, I want to check that the referring template is the right one.

This works ok except in a couple of cases where cgi.referer not only returns the path and template name but it also returns a querystring like path/templatename?a='#a#'& etc.

In the form in the referring template, method="post",  and I don't explicitly pass parameters in URLs.

I can still check for the right template etc but I don't know why cgi.referrer is acting differently in those places/

What can cause this ?

This topic has been closed for replies.

1 reply

Inspiring
October 21, 2009

If the form page was called from a link that included url variables, those variables would be included in the http_referrer value when the form is submitted.

October 22, 2009

Thanks for relying Mr. Bracuk. It isn't called from a link ; it's called from a submit button.

What other things can cause this ?

Inspiring
October 22, 2009

Apparently I was not sufficiently clear.

If you submit your form and see a query string in your http_referrer variable, use your browser back button to return to your form page.  Look at the address bar.  You will probably see that same query string.