Code: Select all
$dd1= "<select><option>select one</option></select><select><option>No</option></select><select><option>No</option></select>";
$x=0;
if ($dd1 == "yes"){
$x +=10;
}
Moderator: General Moderators
Code: Select all
$dd1= "<select><option>select one</option></select><select><option>No</option></select><select><option>No</option></select>";
$x=0;
if ($dd1 == "yes"){
$x +=10;
}
Code: Select all
<?php
$num1 = 0;
$boolpool = $bool1 + $bool2;
$bool = $_POST['bool'];
$text1 = "<input type=\"text\" name=\"bool\">";
if ($bool == "yes"){
$num = $num += 10;
echo $num;
}
else if ($bool == "no"){
$num = $num -= 10;
echo $num;
}
else if ($bool == "na"){
$num +=0;
}
$num2 = 0;
$bool2 = $_POST['bool2'];
$text2 = "<input type=\"text\" name=\"bool2\">";
if ($bool2 == "yes"){
$num2 = $num2 += 10;
echo $num2;
}
else if ($bool2 == "no"){
$num2 = $num2 -= 10;
echo $num2;
}
else if ($bool2 == "na"){
$num2 +=0;
}
echo $boolpool;
?>
<html>
<head>
<title></title>
</head>
<body>
<form action="try.php" method="post">
<?php echo $text1; echo $text2; ?>
<input type="submit">
</form>
</body>
</html>
Code: Select all
$num1 = 0;
$bool = $_POST['bool'];
$text1 = "<input type=\"text\" name=\"bool\">";
if ($bool == "yes"){
$num = $num + 10;
}
else if ($bool == "no"){
$num = $num + 0;
}
else if ($bool == "na"){
$num +=0;
}
$num2 = 0;
$bool2 = $_POST['bool2'];
$text2 = "<input type=\"text\" name=\"bool2\">";
if ($bool2 == "yes"){
$num2 = $num2 + 10;
}
else if ($bool2 == "no"){
$num2 = $num2 + 0;
}
else if ($bool2 == "na"){
$num2 +=0;
}
$boolpool = $num + $num2;
echo $boolpool;