This topic is locked
[SOLVED]

 Redirect in BeforeRecordAdded.

4/7/2011 5:29:19 AM
PHPRunner General questions
A
agentsmith author

I tried the code in the manual for exploding arrays and while the records were added, the redirection doesn't work. I've tried echoing Javascript and the page still doesn't redirect.

global $conn;
if ($values["fieldname"])
{
$arr = explode(",",$values["fieldname"]);
// This is the name of the multi check box or
// list select field, its value becomes $arr
for ($i=0;$i<count($arr);$i++)
{
$strInsert = "insert into TableName (field) values ('".$arr[$i]."')";
// add more fields from the add page to be inserted into database

db_exec($strInsert,$conn);
}
header("Location: MyPage_list.php");
// Exit and Redirect to the list page after updating database
exit();
}
Sergey Kornilov admin 4/7/2011

Redirect should work on regular Add page. It won't work in inline mode or when you add master and details on the same page.
If this doesn't help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

A
agentsmith author 4/7/2011

I'm updating another table from the add page in before record added events. I might have to redesign the add process to avoid using arrays.
Thanks for the explanation.



Redirect should work on regular Add page. It won't work in inline mode or when you add master and details on the same page.
If this doesn't help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.