In order to redirect to a child add instead of a child list if there is no child record, I borrowed some code in the archive however I get only blank child list page instead of a child add.
mastertable is b
Id (autoinc)
info
child table is _d_5ASA
Field1 (autoinc)
visitId
info
I use list (before process) event on the _d_5ASA
[codebox]
global $conn;
if (@$_REQUEST["masterkey1"])
{
$str = "select * from _d_5ASA where visitId=".$_REQUEST["masterkey1"];
$rs = db_query($str,$conn);
if ($data = db_fetch_array($rs))
{
header("_d_5ASA_view.php?editid1=".$data["Field1"]);
exit();
}
else
{
header("_d_5ASA_add.php?mastertable=b&masterkey1=".$_REQUEST["masterkey1"]);
exit();
}
}[/codebox]
Where would be my error?