Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! make calculation that retains its input values after calc..

Status
Not open for further replies.

mk2lee1

MIS
Jul 8, 2003
51
US
Hi, I am fairly new to php, and i want to create the website that calculates the use case point. And this is to be done like a calcuator. Please refer to nhlbisupport.com/bmi/bmicalc.htm this website (no when you look at this site, you input the data your height and weight, and when pressing the compute BMI, we'll get the result. But the website do not refreshes (or it seems it doesn't, well doesn't really matter if it does..) and all the values that was inputed is still in the text box.
What functions do i have to use to make this kind? do i use sessions to hold the variable? Ne ideas?
Please help me on this issue....Thank you...
 
If you want to do it exactly as that page does, you need to post your question in the JavaScript forum. That page uses JavaScript to perform its calculations.

If you want to duplicate the output of that page using PHP, then I recommend that you write a script that is in two parts divided by an if...else statement.

If the user provided input, then perform calculations and display the page.

else, just display the page.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
you could use sessions but before they will work the page must have a .php not .htm

To err is human, to completely mess up takes a computer. [morning]
 
Just a note:
You can tell your web server to execute PHP in any type of file extension. You could also include .htm, .html etc.
The requirement that csniffer states is true for most systems, however, to be really accurate it should say:
You need to have the file type extension be a valid extension for the web server to invoke PHP interpreter to process the code. ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top