Calculate Net Salary
<?php
if(isset($_POST["b1"]))
{
$sal = $_POST["t1"];
$hra = $_POST["t2"];
$da =
$_POST["t3"];
$ns = $sal + $hra + $da;
}
?>
<html>
<body>
<form action="Lec2.php"
method="POST">
<table border="5">
<tr>
<td>
Salary :-
</td>
<td>
<input
typ="text" name="t1" />
</td>
</tr>
<tr>
<td>
HRA :-
</td>
<td>
<input
typ="text" name="t2" />
</td>
</tr>
<tr>
<td>
DA :-
</td>
<td>
<input
typ="text" name="t3" />
</td>
</tr>
<tr>
<td
colspan="2">
<input
type="submit" name="b1" value ="RESULT"/>
</td>
</tr>
<tr>
<td>
Net Salary :-
</td>
<td>
<?php
if(isset($ns))
{
echo $ns;
}
?>
</td>
</tr>
<tr>
<td>
Net Salary :-
</td>
<td>
<input
type="text" name="t4" value="<?php if(isset($ns))
echo $ns; ?>"/>
</td>
</tr>
<tr>
<td>
Net Salary :-
<td>
<textarea
rows="5" cols="50" name="ta1"><?php
if(isset($ns)) echo $ns; ?> </textarea>
</td>
</tr>
</table>
</form>
</body>
</html>
Calculate Net Salary
Reviewed by Baljeet Singh
on
11:05
Rating:
No comments: