Alexander
|
| Posted: 07/04/2002, 8:18 AM |
|
Hello,
I use CC with Php.
I've a Record Form in a page that is accessed by 2 other pages.
After record submit I'd like to return back to the calling page.
I'm trying to manage with $HTTP_REFERER, but there's something I don't understand yet.
First, this variable is empty if I check its value in record form Open events.
So I've to save HTTP_REFERER as session variable (let's call it $svaddress) in called page Open Events, and it get this way the right value.
Unfortunately, once the record form is submitted (nevertheless on Update/Cancel/Insert or Delete) $svaddress takes the value of the current page URL (I mean the called page).
Logging errors I see it happens during page Open Events.
Why does the page re-read its open events if the flow is redirect to another page?
And how can I solve the problem?
Thanks for your kind help
Al
|
|
|
 |
Jeff Turkington
|
| Posted: 07/04/2002, 9:04 AM |
|
Hi Al,
I had the same need a while ago. My solution wasn't elegant, but suspect that you have the missing piece to make this work they way I wanted, namely the HTTP_REFERRER parameter. See the link to my oroiginal post at http://www.gotocode.com/disc_viewt.asp?mid=12214&s_topic=return+page&
Regards,
Jeff
|
|
|
 |
Chris K.
|
| Posted: 07/04/2002, 9:23 AM |
|
This happens because CC always redirects to target page after successful submit (without showing components). All forms are processed and then redirection is made according to $sActionFileName variable. You can setup this variable in AfterUpdate/Insert etc event to change redirection page.
About your problem with $HTTP_REFERER variable. This happens Form events are executed inside ..._Show and ..._Action functions and in PHP global variables aren't visible inside functions by default. Page events are executed in the global scope. Just declare global $HTTP_REFERER variable before using in event:
global $HTTP_REFERER;
The same with your session variable. Declare it as global too before assigning to $sActionFileName.
|
|
|
 |
|