This topic is locked

Redirect Page

7/31/2012 6:37:51 PM
PHPRunner General questions
T
Tempus_Erus author

Hi,
Little lost on this.....
After a record is added - in the after record added event I would like to redirect to the edit page to the record just added.
So I enter a record that now has an ID of 50 for example.
header("Location: maintable_edit.php?editid1=".$values["tID"]); tID would be the record ID.
In theory this should be 50? I have also tried replacing the $values with $keys but the record does not redirect.
I have tried directly placeing 50 in the field and this works.
header("Location: maintable_edit.php?editid1=50"]);
Any help would be appreciated and I am probably missing the obvious!
Thanks,

C
cgphp 7/31/2012

In the "After record added" event, try to echo the tID value;

echo $keys['tID'];

exit();
T
Tempus_Erus author 8/2/2012



In the "After record added" event, try to echo the tID value;

echo $keys['tID'];

exit();



Thanks Cristian,
This was the first thing I tried....return blank.............

C
cgphp 8/2/2012

Is tID the primary key? Is it autoincrement?

T
Tempus_Erus author 8/2/2012



Is tID the primary key? Is it autoincrement?


Primary Key...............

C
cgphp 8/2/2012

Is it autoincrement?

T
Tempus_Erus author 8/2/2012



Is it autoincrement?


Yes it auto increments.......

C
cgphp 8/3/2012

Do you get errors when you try to redirect the page? Check firebug!