PHP Classes

File: fwphp/glomodul/z_examples/book_video/fahrenheit2celsius_post.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/glomodul/z_examples/book_video/fahrenheit2celsius_post.php  >  Download  
File: fwphp/glomodul/z_examples/book_video/fahrenheit2celsius_post.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 3 months ago
Size: 626 bytes


Class file image Download
<head><title>Temperature Conversion</title></head>
<?php if ($_SERVER['REQUEST_METHOD'] == 'GET') { ?>
 <form action="<?php echo $_SERVER['PHP_SELF'] ?>"
   Fahrenheit temperature:
   <input type="text" name="fahrenheit" /><br />
   <input type="submit" value="Convert to Celsius!" />
  <?php }
else if (
$fahrenheit = $_POST['fahrenheit'];
$celsius = ($fahrenheit - 32) * 5 / 9;
printf("%.2fF is %.2fC", $fahrenheit, $celsius);
else {
"This script only works with GET and POST requests.");

For more information send a message to info at phpclasses dot org.