Ver Mensaje Individual
  #6 (permalink)  
Antiguo 04/04/2012, 10:45
alexdefelipe
 
Fecha de Ingreso: mayo-2011
Mensajes: 22
Antigüedad: 13 años
Puntos: 1
Respuesta: Como usar una variable en otros archivos

Disculpa mi torpeza, pero sigue sin funcionarme. He pasado todas las variables y funciones a un archivo diferente. Pero, cuando quiero que me muestre el valor de un variable, no lo hace y no sale nada. Estos son los archivos:
VARIABLES:
Código PHP:
$esp=isset ($_POST['esp'])?$_POST['esp']:'';
$tiempo=isset ($_POST['tiempo'])?$_POST['tiempo']:'';
$vel=isset ($_POST['vel'])?$_POST['vel']:'';
$espresNULL;
$velres=NULL;
$tiempores=NULL;

function 
espveltiempo()
{
    global 
$esp;
    global 
$tiempo;
    global 
$vel;

ARCHIVO DONDE SE MUESTRA:
Código PHP:
<?php include ('variables.php'); ?>
<p>La fórmula general del movimiento rectilíneo uniforme es: V= <sup>S</sup>&frasl;<sub>T</sub>.
<p>Sustituyendo, tendremos lo siguiente:</p>
<p><blockquote>
<?php 
espveltiempo
();
print 
$esp;  
print 
$tiempo
?>
</blockquote></p>
¿Cómo puedo solucionarlo?