Foros del Web » Programando para Internet » PHP »

Tomar valores desde una paginacion

Estas en el tema de Tomar valores desde una paginacion en el foro de PHP en Foros del Web. Hola: Estoy desarrollando una pagina en la cual se puede responder por registro con submit, ne llegan los campos vacios y no se porque, por ...
  #1 (permalink)  
Antiguo 25/03/2011, 13:44
Usuario no validado
 
Fecha de Ingreso: abril-2009
Ubicación: Buenos Aires
Mensajes: 413
Antigüedad: 15 años
Puntos: 3
Tomar valores desde una paginacion

Hola:
Estoy desarrollando una pagina en la cual se puede responder por registro con submit, ne llegan los campos vacios y no se porque, por las dudas les paso el codigo a ver si alguien puede ayudarme:

<?php
session_start();
include_once("../includes/procs.php");
include_once('../includes/tiemposession.php');
include_once('../includes/conexiones.php');
include_once("../includes/clases.php");
conectarse();
$idusuario=limpia($_SESSION['idusuario']);
$ahora=date('Y-m-d h:i:s');
$detallebusqueda=limpia($_POST['busqueda']);
$voya="publicacion1m.php";
$empresa=$_SESSION['empresa'];

mensaje("genera_".$_POST['genera']);
mensaje("respuesta_".$_POST['respuesta']);
mensaje("idpregunta_".$_POST['idpregunta']);

if (isset($_POST['genera']) and !empty($_POST['respuesta'])) {
$idpregunta=limpia($_POST['idpregunta']);
$descripcion=limpia($_POST['respuesta']);
$Respuesta=new Respuesta();
$Respuesta->setidpregunta($idpregunta);
$Respuesta->setfecha(date("Y/m/d H:i"));
$Respuesta->setdescripcion($descripcion);
$Respuesta->insertRespuesta();
mensaje("Se ha Grabado la Respuesta");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo $empresa." - Preguntas sin Responder";?></title>
<link href="../css/stylo0.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="calendar.css">
<script language="JavaScript" src="calendar_eu.js"></script>
<style type="text/css">
</style>
<body>
</head>
<?php
include("cabecera.php");
?>
<table width="825" height="129" border="0" align="center" class="pagina" >
<tr>
<td width="810" height="100" align="center" valign="top" class="tdcentro">
<?php
include("barrausuario.php");
?>
<table width="98%" border="1" align="center">
<tr>
<th width="14%" align="right" valign="middle" scope="row"><div align="center" class="cabcon" >Foto</div></th>
<th width="86%" align="right" valign="middle" scope="row"><div align="center" class="cabcon" >Preguntas sin Responder </div></th>
</tr>
<?php
include_once '../includes/PHPPaging.lib.php';
$paging = new PHPPaging;
$paging->modo('desarrollo');
$paging->porPagina(20);
$query="select preguntas.idpregunta, preguntas.descripcion as pregunta, publicaciones.idpublicacion,foto1,titulo,publicaci ones.cantidad,publicaciones.precio,visitas,fechaal ta,fechavenc, space(500) as respuesta from preguntas left join publicaciones using(idpublicacion) where publicaciones.idusuario='$idusuario' and preguntas.idpregunta not in (select idpregunta from respuestas) order by idpublicacion,preguntas.fecha";
$paging->agregarConsulta($query);
$paging->verPost(true);
$paging->linkAgregar('#busqueda');
$paging->mantenerVar("foto1","pregunta","respuesta");
$paging->ejecutar();
while($datos = $paging->fetchResultado()) {
echo "<tr>";
echo '<tr class="cabcon">';
?>
<th height="52" align="center" valign="top" scope="row">
<?php echo "<img src=".((empty($datos['foto1'])) ? foto_no_disponible() : carpeta_fotos().$datos['foto1'])." name=foto1 id=foto1 height=120 width=120/>";?> </th>
<th align="left" valign="middle" scope="row">
<?php echo strtoupper($datos['titulo'])."<br>";
echo "<fieldset>";
echo "<legend>Pregunta</legend>";
echo '<table width="622" border="1">';
echo "<tr>";
echo "<td>";
echo $datos['pregunta'];
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</fieldset>";
echo "<fieldset>";
echo "<legend>Respuesta</legend>";
echo "<textarea name='respuesta' cols='80'>";
echo $datos['respuesta'];
echo "</textarea>";
echo "</fieldset>";
?>
<form action="preguntassinresponder.php" name="form1" method="post">
<input type="hidden" name="idpregunta" value="<?php $datos['idpregunta']?>">
<input type="hidden" name="respuesta" value="<?php $datos['respuesta']?>">
<input type="submit" value="Responder" name="genera" id="genera"/>
</form>
</th>
<?php
echo "</tr>";
}
?>
</tr>
</table>
<tr align="center" valign="middle">
<th width="784" height="20" align="center" valign="middle" scope="row"><?php
echo "<b>Página ".$paging->numEstaPagina()." de ".$paging->numTotalPaginas()."<br />";
echo "</b>Mostrando ".$paging->numRegistrosMostrados()." resultados, del ".$paging->
numPrimerRegistro()." al ".$paging->numUltimoRegistro();
echo " de un total de ".$paging->numTotalRegistros()."<br /><br />";
echo $paging->fetchNavegacion();
?>
</td> </tr>

<?php
include("barravacia.php");
include("pie.php");
?>
</table>
</body>
</html>

arriba estan los 3 mensajes en los cuales idpregunta y respuesta me llegan vacios.
Muchas Gracias
  #2 (permalink)  
Antiguo 25/03/2011, 13:52
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Tomar valores desde una paginacion

lo que sucede es que no imprimes los valores con echo dentro de los values...
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #3 (permalink)  
Antiguo 25/03/2011, 15:24
Usuario no validado
 
Fecha de Ingreso: abril-2009
Ubicación: Buenos Aires
Mensajes: 413
Antigüedad: 15 años
Puntos: 3
Respuesta: Tomar valores desde una paginacion

Perfecto amigo. Muchas Gracias

Etiquetas: paginacion, tomar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:11.