D
DominiKiD
Guest
here is the code... im new at this...
<form id="form1" name="form1" method="post" action="joel.php">
<?php
$message;
if (isset($_POST['ok']))
{
if ($_POST['num1']=" ") {$message = "please enter the first number";}
elseif ($_POST['num2']=" ") {$message = "please enter the second number";}
else{
$n1 = $_POST['num1'];
$n2 = $_POST['num2'];
$total = $n1+$n2;
$message = "thank you";
}
}
?>
<p>*</p>
<p>*</p>
<p>*</p>
<table width="460" height="140" border="1">
<tr>
<td colspan="3"><?php echo $message;?>*</td>
</tr>
<tr>
<td width="95">number1</td>
<td width="290"><label>#1
<input type="text" value="" name="num1" id="num1" />
</label></td>
<td width="53">*</td>
</tr>
<tr>
<td>number2</td>
<td><label>#2
<input type="text" name="num2" id="num2" value=""/>
<input type="submit" name="ok" id="ok" value="ok" />
</label></td>
<td>*</td>
</tr>
<tr>
<td colspan="3">*</td>
</tr>
<tr>
<td height="26">total</td>
<td><?php echo "your total is...".$total; ?>*</td>
<td>*</td>
</tr>
</table>
<p>*</p>
</form>
</body>
</html>
<form id="form1" name="form1" method="post" action="joel.php">
<?php
$message;
if (isset($_POST['ok']))
{
if ($_POST['num1']=" ") {$message = "please enter the first number";}
elseif ($_POST['num2']=" ") {$message = "please enter the second number";}
else{
$n1 = $_POST['num1'];
$n2 = $_POST['num2'];
$total = $n1+$n2;
$message = "thank you";
}
}
?>
<p>*</p>
<p>*</p>
<p>*</p>
<table width="460" height="140" border="1">
<tr>
<td colspan="3"><?php echo $message;?>*</td>
</tr>
<tr>
<td width="95">number1</td>
<td width="290"><label>#1
<input type="text" value="" name="num1" id="num1" />
</label></td>
<td width="53">*</td>
</tr>
<tr>
<td>number2</td>
<td><label>#2
<input type="text" name="num2" id="num2" value=""/>
<input type="submit" name="ok" id="ok" value="ok" />
</label></td>
<td>*</td>
</tr>
<tr>
<td colspan="3">*</td>
</tr>
<tr>
<td height="26">total</td>
<td><?php echo "your total is...".$total; ?>*</td>
<td>*</td>
</tr>
</table>
<p>*</p>
</form>
</body>
</html>