This topic is locked
[SOLVED]

 How To Pass And Retrieve A Variable For Page Redirect

4/22/2013 1:55:25 PM
PHPRunner General questions
W
wfcentral author

I have a page the user edits
contacts_linked_edit.php?editid1=186&master=7438#
I have managed to pass a value on the end of the URL successfully (&master=7438)
I tried this code to get it to go back to the master page after save
//** Redirect to another page ****

$master = $_GET['master'];

header("Location: contact2document_lease_list.php?mastertable=RPT_documents_LEASE&masterkey1=".$master);

exit();
but, it does not work because the $master value is not being passed to the redirect URL

Sergey Kornilov admin 4/22/2013

The value of 'master' will be only passed on the first Edit page entrance. It won't stay there after record is saved.
I recommend to save "master" value in session variable

  1. BeforeProcess event:

if ($_GET['master'])

$_SESSION['master']=$_GET['master'];


2. AfterEdit event:

header("Location: contact2document_lease_list.php?mastertable=RPT_documents_LEASE&masterkey1=".$_SESSION['master']);

exit();
J
jackolantern 5/13/2013



The value of 'master' will be only passed on the first Edit page entrance. It won't stay there after record is saved.
I recommend to save "master" value in session variable

  1. BeforeProcess event:

if ($_GET['master'])

$_SESSION['master']=$_GET['master'];


2. AfterEdit event:

header("Location: contact2document_lease_list.php?mastertable=RPT_documents_LEASE&masterkey1=".$_SESSION['master']);

exit();



how to clear mastertable and masterkey1 variable, coz it still exist, if am use redirect filtering link by use field name filtering.