This topic is locked

How to redirect

3/3/2009 5:09:56 AM
PHPRunner General questions
L
Lisa2006 author

Hi Forum,
I have a list page with edit and view columns. I need to redirect to a custom page as opposed to the actual table page when the edit or view links are clicked.
In PHPRunner 4.2 this was straight forward. I would simply edit the code via visual editor as follows for the 'Edit' column:
Orignal code

<TD vAlign=middle align=middle><A

class=tablelinks2

href="customers.php?{$row.1editlink}">Edit</A>

</TD>
Amended Code

<TD vAlign=middle align=middle><A

class=tablelinks2

href="[color=#8b0000]custom_page_customers.php?{$row.1editlink}">Edit</A>

</TD>

[/color]

How can i achieve the above in PHPRunner 5.0. My code snippet looks as below:

{BEGIN edit_column}<TD vAlign=middle align=middle>{BEGIN edit_link}<A class=tablelinks

{$editlink_attrs}>Edit</A> {END edit_link}</TD>{END edit_column}
Thanks in advance
Lisa

J
Jane 3/3/2009

Hi,
use List page: After record processed event to change edit link:

$editlink=" editid1=".htmlspecialchars(rawurlencode($data["RecordID"]));

$record["editlink_attrs"]="href=\"TableName_edit.php?".$editlink."\" ";

L
Lisa2006 author 3/3/2009

Hi Jane,
I have added the following code to my customers table | List page: After record processed
));

$record["editlink_attrs"]="href=\"custom_page_customers_edit.php?".$editlink."\" ";
However when i execute the project nothing happens.
On customers_list.php, when i hover over the 'Edit' link all i see is customers_edit.php?editid1=20

When the 'Edit' link is clicked it takes me to customers_edit.php?editid1=20

I need this to take me to custom_page_customers_edit.php?editid1=20
In the above code snippet, i have also changed RecordID to ID ... again nothing happens.
Your help would be appreciated.
Lisa

L
Lisa2006 author 3/4/2009

Help needed please.
Thanks
Lisa

J
Jane 3/4/2009

Hi,
please make sure you have declared $record as global array before:

global $record;

$editlink=" editid1=".htmlspecialchars(rawurlencode($data["RecordID"]));

$record["editlink_attrs"]="href=\"custom_page_customers_edit.php?".$editlink."\" ";

L
Lisa2006 author 3/4/2009

Hi Jane,
Works a treat
Thanks a million
Lisa