Im trying to write a script that takes two post values from drop down forms on the previous page and sets a variable to be used in the "action" part of a form on the page to control direction of the submit. The purpose is the value of the drop downs is zero if not used, I want to change the direction of the page if both drop downs are not used.
Code: Select all
$id1=$_POST['id1'];
$id2=$_POST['id2'];
if($id1 == 0 and $id2 == 0) {
$action="foo";
} else {
$action="foo2";
blablabla
<form action="<? echo $action?>.php" method="post">
}
I don't know what i'm missing but the script is going to foo2 even if both values are 0.
I have confirmed the values posted are 0 by echoing them in the page.
Is there somthing simple I am missing?