This topic is locked

automatic redirect

11/18/2007 10:01:33 AM
PHPRunner General questions
E
ellesse author

hello,

i have two table, master_invoice and detail_invoice used for insert invoices. I use master-detail relationship on ID field primary key. All ok.
I want that when i save master record, the page go to the detail page automatically. how i do that? (i think that need the new masterkey value. how i retrieve it?)
How i generate the invoice page to print? (in visual manner. Exist a software that you reccomended?)
Thank you
(sorry for my bad english)

J
Jane 11/19/2007

Hi,
you can do it using After record added event on the Events tab.

Here is a sample code:

header("Location: DetailTableName_list.php?mastertable=MasterTableName&masterkey1=".$keys["IDField"]);

exit();



where IDField is your actual field name, DetailTableName and MasterTableName are your actual table names.
To add print page check off corresponding option on the Choose pages tab in the PHPRunner.

L
lordkain2 7/27/2008

Hi Jane, I'm using the above code to redirect from add page of master table to list of detail:

header("Location: almuerzos_d_list.php?mastertable=almuerzos&masterkey1=".$keys["Id_Alm"]);


but the result link is:

http://localhost/adm/almuerzos_d_list.php?mastertable=almuerzos&masterkey1=


Please help me.
Note: Id_Alm is a auto_increment field (Mysql).

Hi,

you can do it using After record added event on the Events tab.

Here is a sample code:
where IDField is your actual field name, DetailTableName and MasterTableName are your actual table names.
To add print page check off corresponding option on the Choose pages tab in the PHPRunner.

J
Jane 7/28/2008

Hi,
try to use this code:

header("Location: almuerzos_d_list.php?mastertable=almuerzos&masterkey1=".mysql_insert_id());

L
lordkain2 7/29/2008

Thanks Jane.