Make Calculator from PHP script
|
|||||||
Below is a sample php code addition. May be useful:
<?php
if ($_POST['submit'])
{
$bil1 = $_POST['bil1'];
$bil2 = $_POST['bil2'];
$hasil = $bil1 + $bil2;
echo “Hasil penjumlahannya adalah “.$hasil;
}
else
{
?>
<form method=”post” action=”<?php echo $_SERVER['PHP_SELF']; ?>”>
<table>
<tr><td>Bil Pertama</td><td>:</td><td><input type=”text” name=”bil1″></td></tr>
<tr><td>Bil Kedua</td><td>:</td><td><input type=”text” name=”bil2″></td></tr>
<tr><td></td><td></td><td><input type=”submit” name=”submit” value=”Submit”></td></tr>
</table>
</form>
<?php
}
?>
Note:–> note the sign “..” must be equal precision “..”
A few of us, let us share with each other here. If anyone asks, the author does not have the right answer, because the writer is a beginner who is just learning. Let us discuss together
, thanks my friend had been to this site. Make Calculator from PHP script.. (word&phrase: Make Calculator from PHP script, php code calculator, calculator kode)
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
Share This Article
Sign up Free Email Newsletter
Stay Updates with this Blog. Get Free email newsletter updates, Enter your Email here:Don't forget to confirm your email subcription







No Comment to “Make Calculator from PHP script”