Ver Mensaje Individual
  #14 (permalink)  
Antiguo 16/01/2009, 07:45
tirengarfio
 
Fecha de Ingreso: septiembre-2008
Mensajes: 146
Antigüedad: 16 años, 6 meses
Puntos: 1
Respuesta: Pasar una variable php en una pagina con un formulario

Hola de nuevo,

he resuelto mi problema creando una sesion.


Aqui teneis los codigos:

Código PHP:
<?php 
session_start
();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head><title></title> 

<style type="text/css" media=all> 

</style> 
</head> 

<body> 


<form method="POST" action="http://localhost/red_social/resultado_busqueda.php"> 

<?php 

$var
="Hola";
$_SESSION["var"] = $var;

?> 

<input type="text" name="nombre"><br> 
<input type="text" name="apellidos"><br> 
<input type="text" name="email"><br> 
<input type="text" name="telefono"><br> 
<input type="text" name="domicilio"><br> 
<input type="text" name="fechanacimiento"><br> 
<input type="submit" name="Buscar"><br> 
<input name="flag" type="hidden" id="flag" value="<?php echo $_POST['flag'?>"> 
</form>

</body>

</html>
Código PHP:

<?php
 session_start
(); 
?>
<html> 
<head><title></title> 

<style type="text/css" media=all> 

</style> 
</head> 

<body> 

<?php 
echo $_SESSION["var"]; 
?> 
</body> 
</html>