HTML CODE <div style="padding-left:40px"> <h2> PHP Calculator</h2> <form method="post" action=""> Enter value: <input type="text" name="value"> <br> <br> <div style="padding-left: 105px"> <input type="submit" value="9" name="button"> <input type="submit" value="8" name="button"> <input type="submit" value="7" name="button"> <input type="submit" value="+" name="button"> <br> <input type="submit" value="6" name="button"> <input type="submit" value="5" name="button"> <input type="submit" value="4" name="button"> <input type="submit" value="-" name="button" style="padding-left: 9px"> <br> <input type="submit" value="3" name="button"> <input type="submit" value="2" name="button"> <input type="submit" value="1" name="button"> <input type="submit" value="/" name="button" style="padding-left: 9px"> <br> <input type="submit" value="0" name="button" style="padding-left:33px"> <input type="submit" value="." name="button" style="padding-right:9px"> <input type="submit" value="x" name="button" style="padding-left: 7px"> <br> </div> <br> <input type="submit" value="Calculate" name="Calculator"> </form> </div> PHP CODE : <?php if (isset($_POST["Calculate"])) { echo $_POST["button"]; } ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)