problem to get the Referer page

319 Views Asked by At

I'm trying to get the referer page, but i have a problem , sometimes i get bad the referer page, for example:

i have 3 pages, when the page 1 link to page 2 , and the page 2 make a process and after redirect to page 3, so when i try to get the referer page in the page 3, i get the page 1 and not the page 2,

I think that the problem is the page 2 this page doesn´t show anything to the user, is only a page who make a procedure.

Do you have any idea how i can to get the referer page correctly??

Thanks.

I'm using TCL with openacs

3

There are 3 best solutions below

1
On BEST ANSWER

how are you sending the user from page 2 to page 3? with php:

enter code hereheader("location:")

or html redirect? if you are using header("location:") it will probably not work. try using html redirect like

<meta HTTP-EQUIV="REFRESH" content="0; url=page3">
0
On

It's difficult to answer without knowing exactly what you're trying to do. If page 2 is only calling a procedure, what about putting the contents of page 2 into an ad_proc, and then calling that proc in page 3? Or can page 2 redirect to other places when it is finished?

If you give more info, I'm sure I can help. The normal way I would pass referer info in OpenACS is to use a variable called return_url, which I pass from one page to the next as a hidden form element. There are lots of examples of that in OpenACS. Alternatively you could use ad_set_client_property to store it on page 1 and then on page 3 use ad_get_client_property to read it.

0
On

Thanks to everyone,

I already solve my problem using the < meta HTTP-EQUIV="REFRESH" content="0; url=page3" >, but in openacs there is a function that do it.

I relplace the

       ad_returnredirect

by

       util_ReturnMetaRefresh

so in this way i already can read the correct referer page