PDA

View Full Version : Calculator help


Jaynesh
01-24-2006, 04:37 PM
Im learning php and to practise i thought il make a little calculator.

Ive a made a simple basic one ( you can see it in action here http://www.lyricalsoundz.com/learning.html )

Right now it only multiplies the two numbers.

How can i make an option in the form to choose if i want to multiply, divide, add, subtract.

I can do the HTML form part i just need help in the php part.

Heres the code...

<?php
print $_POST['number1']."x".$_POST['number2']."=".$_POST['number1'] * $_POST['number2']."";
?>