Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/11/2008, 12:49
charlymon3d
 
Fecha de Ingreso: noviembre-2008
Mensajes: 11
Antigüedad: 15 años, 5 meses
Puntos: 0
Problema al ejecutar una variable con echo

bien mi problema es que yo me paso esto mediante un formulario(POST) y lo guardo en una funcion $campos:

<tr><td ALIGN=CENTER> <?=$row['programacion'];?> </td>

<tr><td ALIGN=CENTER> <?=$row['nombre'];?> </td>

y luego llamo a la variable campos mediante un

echo $campos;

y el problema es que no me rellena los campos de la base de datos como deberia hacerlo, sin embargo haciendo lo mismo con la variable $titulos que contiene esto si finciona:


<th ALIGN=CENTER><B> programacion </B> </th>
<th ALIGN=CENTER><B> nombre </B> </th>


Os dejo el codigo entero por si me podeis ayudar:



<html>
<head>
<title>Altas Embolao</title>

<link href="../tabla/tablecloth/tablecloth/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="tablecloth/tablecloth.js"></script>

<?php
function Conectarse()
{
if (!($link=mysql_connect("localhost","root","")))
{
echo "Error conectando a la base de datos.";
exit();
}
if (!mysql_select_db("embolao",$link))
{
echo "Error seleccionando la base de datos.";
exit();
}
return $link;
}

?>

</head>

<body>
<?php

$titulos=$HTTP_POST_VARS['titulos'] ;
$campos=$HTTP_POST_VARS['campos'] ;

?>
<FONT SIZE=2>



<table border="3" >
<tr>

<?
echo $titulos;
?>


</tr>
<form name="form">
<input type=text value="<?=$HTTP_POST_VARS['campos']?>" name="tit">
</form>
<?php

$link=Conectarse();
$consulta=$HTTP_POST_VARS['consulta'] ;
$columnas=$HTTP_POST_VARS['columnas'] ;


$sql = mysql_query("select * from clientes_beetho $consulta",$link);

$num_rows = mysql_num_rows($sql);
?><font size=5><?
echo "La Consulta Contiene $num_rows Registros" ;
?></font><?

while($row = mysql_fetch_array($sql))
{

echo $campos;
?>


</tr>
<?
} ?>
<?

mysql_close($link);


?>

</font>

</body>
</html>





MUCHAS GRACIAS A TODOS