fsdfsd

<!DOCTYPE html>
<html>
<body>

<h1> This is my first calculator>
<form  method="post">
1st<input type="number" name="x"><br>
2nd<input type="number" name="y"><br>
  <button type="submit" name="submit1" value="submit">addition</button>
  <button type="submit" name="submit2" value="submit">minus</button>
     <button type="submit" name="submit3" value="submit">multiply</button>
           
<button type="submit" name="submit4" value="submit">devide</button>
           



</form>



</body>
</html>


<?php
if (isset($_POST['submit1'])) {

$x = $_POST['x']; 
$y = $_POST['y'];

echo $x + $y;
             

}
if (isset($_POST['submit2'])) {

$x = $_POST['x']; 
$y = $_POST['y'];

echo $x - $y;
             

}
if (isset($_POST['submit3'])) {

$x = $_POST['x']; 
$y = $_POST['y'];

echo $x * $y;
             

}
if (isset($_POST['submit4'])) {

$x = $_POST['x']; 
$y = $_POST['y'];

echo $x / $y;
             

}
?>

Comments

Popular posts from this blog

jjjjjjjjjjjjjjj