Need Help with temperature converter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
maboroshi
Forum Commoner
Posts: 25
Joined: Thu Nov 13, 2003 10:10 am

Need Help with temperature converter

Post by maboroshi »

Hey I am having problems trying to get this code to work on an IIS server it works fine on my apache server both have registered globals turned off

what this code does is you enter in a form degrees in celsius and it converts it to farenheit but for some reason on the iis server it just displays the number 32 any help is appreciated

Code: Select all

<?php

$result = ($degrees*9)/5+32;
echo "<p class="style2">";
echo $result;
echo " Farenheit</p>";

?>
leenoble_uk
Forum Contributor
Posts: 108
Joined: Fri May 03, 2002 10:33 am
Location: Cheshire
Contact:

Post by leenoble_uk »

Might be that it's treating your $degrees variable as a string for some reason. null + 32 is 32
maboroshi
Forum Commoner
Posts: 25
Joined: Thu Nov 13, 2003 10:10 am

I feel stupid

Post by maboroshi »

Hey thanks I figured it I had to type $_POST I guess that means registered globals is on
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Nop, it does mean your Apache have register_globals on and your IIS have register_globals off.
Post Reply