This topic is locked

How to redirect to the list page

7/5/2007 12:11:26 PM
PHPRunner Tips and Tricks
Sergey Kornilov admin
function get_file_base($name) {

$ext = strrchr($name, '_');

if($ext !== false) {

$name = substr($name, 0, -strlen($ext));

}

return $name;

}



global $PHP_SELF;



header('Location: ' . get_file_base($PHP_SELF) . '_list.php?a=return');

exit();
I
ialameh 7/7/2007

Here to go "After Record Update" on any page

global $_SERVER;

$name = $_SERVER['PHP_SELF'];

$ext = strrchr($name, '_');

if($ext !== false) {

$name = substr($name, 0, -strlen($ext));

}
header('Location: ' . $name . '_list.php?a=return');

exit();



function get_file_base($name) {

$ext = strrchr($name, '_');

if($ext !== false) {

$name = substr($name, 0, -strlen($ext));

}

return $name;

}
global $PHP_SELF;
header('Location: ' . get_file_base($PHP_SELF) . '_list.php?a=return');

exit();
Allenh 8/9/2007

Is this done on the source code pages? If yes, which one?
Thanks,

A.

Sergey Kornilov admin 8/13/2007

The code that Issam recommends needs to be placed to AfterAdd/AfterEdit events.

gps088 3/14/2010

Hello everybody
This works in your phprunner 5.2.x in afterAdd or afterUpdate?
I am asking, because for me does not works.
Maybe is that, I am using parent with child and with this does not works?
Thank you.

C
ckranichDevClub member 3/17/2010



Hello everybody

This works in your phprunner 5.2.x in afterAdd or afterUpdate?

I am asking, because for me does not works.

Maybe is that, I am using parent with child and with this does not works?

Thank you.


Hello,
I just tried this using phprunner 5.2(Event: After Update) - Works fine!
two variants tried(go back to list page/ go back to view page):
// the following goes back to listpage

header('Location: ' . $name . '_list.php?a=return');
// the following goes back to view page

header('Location: ' . $name . '_view.php?editid1='.$_REQUEST["editid1"]);
Kind Greetings,
Christian

gps088 3/21/2010

Hello to everybody
Yes!

in AfterUpdate works fine
but in AfterAdd doesn't works in my phprunner 5.2 <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=48664&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />
Somebody could try for me, please.

Thank you

gps088 3/21/2010

My tests in phprunner 5.2.0.5154:
In AfterADD only works if you are not including or displaying child records
If you include child records and use this technique or the simple redirect the page do not go show the message that you successfully add a new record.
In AfterUpdate works fine if you have or not child records.
Voila! the end of my tests.
Thank you
I will wait your comments.

Sergey Kornilov admin 3/22/2010

gps088,
you need to contact support team directly at http://support.xlinesoft.com providing more info.