Tuesday, October 22, 2019

Fahrenheit To Celsius in PHP

I wrote a program that will ask the user temperature in Fahrenheit and then it will convert into Celsius temperature equivalent in PHP as my programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.


Sample Program Output


Program Listing

index.php

<!DOCTYPE html>
<html>
<head>
 <title> Fahrenheit To Celsius in PHP </title>
</head>
 <style>
     body {
      font-family: arial;
      font-size:12;
     }  
 </style>
 <body>
   <?php
     error_reporting(0);
     $fahrenheit = $_POST['fahrenheit'];
     $celsius = $_POST['celsius'];

  if (isset($_POST['convert'])){
  $f = $_POST['fahrenheit'];
  $c = ($f-32) * 5/9;
  $display = round($c,2)."". " Degree's Celsius";
  }

  
  if (isset($_POST['clear'])) {
  $fahrenheit = "";
  $celsius = "";
  } 

  ?>

  <h3>Fahrenheit To Celsius in PHP </h3>
  <table>
  <form name="temperature" method="post">
  <tr>
  <td>Temperature in Fahrenheit</td>
  <td><input type="text" name="fahrenheit" value="<?php echo $fahrenheit; ?>"
      required autofocus> </td>
      </tr>
      <tr>
      <tr><td>The Temperature in Celsius is </td>
      <td><input type="text" name="celsius:" value="<?php echo $display;?>"</td></tr>
      <tr></tr></tr>
      <tr>
      <td><input type="submit" value="Convert" name="convert"/>
      &nbsp;&nbsp;&nbsp;
      <input type="submit" value="Clear" name="clear" /></td>
     </tr>
  </form>
     </table>
    </body>
</html>



No comments:

Post a Comment