This topic is locked

redirecting to child add

2/1/2009 5:49:54 PM
PHPRunner General questions
V
vytb author

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?

J
Jane 2/2/2009

Vitas,
your code looks correct.

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.