Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/05/2015, 01:19
isabel5200
 
Fecha de Ingreso: mayo-2015
Ubicación: Hermosillo, Sonora, México
Mensajes: 3
Antigüedad: 9 años
Puntos: 0
Pregunta Problema con PHP (echo)

Hola, buenas a todos, quiero contarles que tengo un problema con mis archivos PHP, bueno, estos programas los probé en el localhost con MySQL, ahí todo perfecto, muestra lo del echo y todo... (estoy usando dos archivos, uno html y otro php que es el que hace la acción) pero a la hora de subirlo a un hosting, ya no muestra nada de lo que debe de contener el echo, pensé que era un problema del hosting pero ya he probado en varios y no sale en ningún lado, no sé cuál pueda ser el problema si pudieran ayudarme...

Este es el archivo HTML:

temperatura.html

<html>
<head>
<meta charset="UTF-8">
<title>Temperaturas</title>

</head>

<body>

<form name="temp" action="temp.php" method="POST">
<center>
<fieldset>
<legend>Convertidor</legend>
<h1>Grados:</h1><input type="text" name="g" class="campo"></br>
</br>
</br>
</br>

<table>
<tr>
<td>
<input type="radio" name="grados" value="f1" checked>Fahrenheit a Centígrados</br>
<input type="radio" name="grados" value="f2" checked>Fahrenheit a Kelvin</br>
<input type="radio" name="grados" value="c1" checked>Centígrados a Fahrenheit</br>
<input type="radio" name="grados" value="c2" checked>Centígrados a Kelvin</br>
<input type="radio" name="grados" value="k1" checked>Kelvin a Centígrados</br>
<input type="radio" name="grados" value="k2" checked>Kelvin a Fahrenheit</br>
</td>



</tr>
</table>

</br>
<input type="submit" name="bot" value="Convertir" class="bot"></br>


</fieldset>
</center>
</form>

</body>

</html>

AHORA EL ARCHIVO PHP:

temp.php

<html>

<head>
<meta charset="UTF-8">
<title>Conversión</title>
</head>

<body>

<center>

<?php
switch ($grados) {
case 'f1':
$gfctotal = ($_POST[g]-32) / 1.8;
echo "$_POST[g] º grados Fahrenheit son $gfctotal º Centígrados";
break;
case 'f2':
$gfktotal = ($_POST[g]-32) / (1.8000) + (273.15);
echo "$_POST[g] º grados Fahrenheit son $gfktotal Kelvin";
break;
case 'c1':
$gcftotal = ($_POST[g] * 1.8) + 32;
echo "$$_POST[g] º grados Centígrados son $gcftotal º Fahrenheit";
break;
case 'c2':
$gcktotal = $$_POST[g] + 273;
echo "$_POST[g] º grados Centígrados son $gcktotal º Kelvin";
break;
case 'k1':
$gkctotal= $_POST[g] - 273;
echo "$_POST[g] º grados Kelvin son $gkctotal º Centígrados";
break;
case 'k2':
$gkftotal= ($_POST[g]-273.15) * (1.8000) + 32;
echo "$_POST[g] º grados Kelvin $gkftotal º Fahrenheit";
break;


}


?>
</font>
</center>

</body>
</html>


La verdad es que ya intenté de todo y no sé cuál pueda ser el problema. Gracias de antemano. Espero y puedan ayudarme.