PHP TEMPERATURE CONVERSION CHALLENGE

PHP TEMPERATURE CONVERSION CHALLENGE



This task has been designed to test your ability to use an HTML form and send data to a PHP script.

TASK 


Design an HTML form to accept input data from the user.

The user should be able to enter:

● temperature ● select from ​o​C or ​o​F

This data will be sent to a PHP script where you will then convert the temperature from ​o​C to ​o​F or vice-versa.

The formula to convert from ​o​F to ​o​C is:
 C = (F - 32) * 5 / 9


The formula to convert from ​o​C to ​o​F is:
 F = C * 9 / 5 + 32

HINTS AND TIPS
 

You will also need to use a conditional statement (IF statement).  This will check the user input.  IF they select ​o​C then do one conversion ELSE do the other.
 You may wish to round answers to the nearest degree or 1 decimal place.



Subscribe - Thapa Technical