Monday, 25 May 2009

A practical sample of a Calculation Form - Getting variables from form

First of all, I create a file called "test.php". On the first line of "test.php", I input php code following:



Next step is to create HTML tags and Body tags. Inside body tags, I create a form that details:

form name="calculation" method="post" action="test.php"

In the form, I have a table with its details



After the form close with /form, I state $result as a result of the mathematical formula when we interact with add, subtract, multiply and divide.



Now, the process of coding is finished, time to test code function.

I assign number 50 to value 1 and number 5 to value 2 then test functions of add, subtract, multiply and divide on firefox web browser.

Each of illustrated images below will show different mathematical formula.








No comments:

Post a Comment