Creating a calculator using PHP is not a hard task but for beginners it’s not so easy. Because PHP is a server side script (local host server and web server). Beginners have to know very well about maintaining it the he/she can start work with it. Ok let’s start creating a normal calculator using PHP.
2. After install, open and active anyone you have from taskbar.
3. Open Dreamweaver or other you prefer. Here I was used Dreamweaver.
4. Create a .php format file and save it to your localhost www or htdocs directory.
5. Now need to design calculator form in HTML. Look like below...
6. Here need to change the test box value/name. You may keep it by default as you like. But if you make change it will help you too easily to understand. I change it to textfield=v1, textfield2=opar and textfield3=v2, keep submit value by default. We need to look a view that how to see the form in HTML code view. Look below...
7. Now need to put PHP code above these HTML form code as like as below...
9. Finished the writing of PHP code just put the main .php page link into the HTML form action. Look below...
10. Now load the page on browser link as http://localhost/PHP%20Project/New_calculator.php. This page will show you the below form ...
11. Now it’s time to operate the calculator.
12. Put “100” value in First Input box, put “+” value in Operation Type box and put “50” value in Second Input. It’s called the addition (+) operation.
13. Its show the result as below...
14. By this method you can make Subtraction (-), Multiplication (*), Division (/), Modulus (%) and many more.
15. Its show the result as below...
That's the simple way to creates a normal calculator. You create more attractive as like as you can Using this system.


