I have the following code to redirect to a add page via the view page (as used in the Cars and Realty templates):
global $dal;
$rs = $dal->functions->Query($strWhereClause,"");
$data = db_fetch_array($rs);
$_SESSION["FunctionID"] = $data["FunctionID"];
$_SESSION["Logo"] = $data["Logo"];
$_SESSION["Company"] = $data["Company"];
$_SESSION["FunctionName"] = $data["FunctionName"];
$_SESSION["Venue"] = $data["Venue"];
$_SESSION["Date"] = $data["Date"];
$_SESSION["Time"] = $data["Time"];
$_SESSION["ReplyMail"] = $data["ReplyMail"];
$_SESSION["RSVPdate"] = $data["RSVPdate"];
?>
<script>
window.location='./form1_add.php';
</script>
<?php
exit();
I want to customise this code to redirect to a different add page depending on the field selection in Type field:
Eg.
If Type in the functions table = Form1, then script should go to
?>
<script>
window.location='./form1_add.php';
</script>
<?php
exit();
If Type in the functions table = Form2, then script should go to
?>
<script>
window.location='./form2_add.php';
</script>
<?php
exit();
etc.
I know this should be achieved with if and else statements but not sure how.
Please assist!