Quote:
<html>
<head>
<title>PHP calculator</title>
</head>
<body>
<?php
$submit =$_POST['submit'];
if($submit!=""){
$var1 =$_POST['var_1'];
$var2 =$_POST['var_2'];
$equal =$var1*$var2;
}
?>
<form name="form1" action="" method="post">
<p>Multiple form</p>
<p><input type="text" name="var_1" value="<?php if($var1){ echo $var1;}?>"/>
* <input type="text" name="var_2" value="<?php if($var2){ echo $var2;}?>"/>
= <input type="text" name="var_3" readonly="readonly" value="<?php if(!$equal){echo 'Fill the form first';}else{ echo $equal;}?>"/>
<input type="submit" name="submit" id="button" value="Calculate" />
</p>
</form>
</body>
</html>
|
try the following code . i think my code is good than Bioshox . hi