Answer the question
In order to leave comments, you need to log in
How to draw a conclusion without reloading the data?
How to make a calculator written in php without reloading the page? here is a sample code:
<?
$a = $_POST['a'];
$b = $_POST['b'];
$b6 = $_POST['b6'];
if ($_POST['button'])
{
$c = $a + $b + $b6; echo "сумма=" . $c.'<br>';
mail("111", "Тема", "$c");
}
?>
<html>
<head>
<meta charset=utf-8>
</head>
<body>
<form method="POST" action="">
<input type="text" name="a" required><br>
<input type="text" name="b" required><br>
<input type="checkbox" name=b6 value="2000"><br>
<input type="submit" name="button" value="Отправить">
</form>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Send a POST request to the server via AJAX and display a response to the user with javascript.
Or rewrite the calculator completely in JS. I had an assignment like this in college.
Here is the solution on codepen
https://codepen.io/evgrom/pen/OQrxYo
There are 4 operations. If you leave only addition, there will be 8 lines of js code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question