This topic is locked

AddOnLoad() with re-direct

8/24/2007 10:57:48 AM
PHPRunner General questions
J
JahWobbler author

I've re-visited this after deciding to purchase phpr and now I'm having problems that I'm sure I didn't have before with the demo download. The version I have is 4.0 build 265.

Basically I want to redirect ADD if displaying Master with Detail. I'm getting a 'Cannot modify headers error message using the header command and if I try the script solution as mentioned in a prior topic regarding listonload , I get re-directed to the menu with the message 'Your session has expired. Please login again' .
error using header code: Cannot modify header information - headers already sent by

(output started at C:\Inetpub\wwwroot\ShotStore\templates_c\%%46^46C^46C9D2DD%%jobs_add.htm.php:8)
Code with header ..... commented out :
function addonload

//** Redirect to another page ****

if (isset( $_SESSION['jobs_masterkey1'] )) {

//Coming from Master detail so make cust read only

//header("Location: jobsro_add.php");

?>

<script>

window.location='./jobsro_add.php';

</script>

<?php

exit();

}
Any help appreciated.

Sergey Kornilov admin 8/24/2007

I recommend you to switch to PHPRunner 4.1 and use BeforeProcessAdd event for redirect purposes.

C
ccuser 8/24/2007

I just put an obstart(); at the top of the event code. That opens the ouput buffer thereby allowing redirecting.
Hope that helps.

J
JahWobbler author 8/25/2007

I recommend you to switch to PHPRunner 4.1 and use BeforeProcessAdd event for redirect purposes.


How do I switch ?

J
JahWobbler author 8/25/2007

I just put an obstart(); at the top of the event code. That opens the ouput buffer thereby allowing redirecting.

Hope that helps.


Didn't work for me. Think I can work around this now though.

Many thanks

Sergey Kornilov admin 8/25/2007

Just download PHPRunner 4.1 and start using it.
See pinned topic on the top of this forum.