Ver Mensaje Individual
  #8 (permalink)  
Antiguo 18/08/2009, 18:07
Avatar de urgido
urgido
 
Fecha de Ingreso: febrero-2005
Mensajes: 2.351
Antigüedad: 19 años, 2 meses
Puntos: 25
Respuesta: Ayuda con funcion de php.

Código PHP:
Ver original
  1. <?
  2. include("sql.php");
  3. $link = conecta_sql();
  4. ?>
  5.  
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <title>Documento sin título</title>
  11.  
  12. </head>
  13. <body>
  14. <?
  15.  
  16. //inicializo pregunta_id para mostrar la primera pregunta de mi BD
  17. if($_REQUEST['pregunta_id']!=""){
  18.  $pregunta_id=$_REQUEST['pregunta_id']+1;
  19. }else{
  20.  $pregunta_id=1;
  21. }
  22.  
  23. ?>
  24.  
  25. <form method="post" action="index.php">
  26. <table width="208" border="1">
  27. <input type="text" value="<? echo $pregunta_id; ?>" name="pregunta_id" style="display:none" />
  28. <?
  29. $consulta = "select * from encuesta_pregunta_opciones where op_pre_id='".$pregunta_id."'";
  30. $ejecuta = mysql_query($consulta,$link) or die(mysql_error());
  31. $fila = mysql_fetch_array($ejecuta);
  32. ?>
  33.   <tr>
  34.     <td width="36"><label>
  35.       <input type="radio" name="radio" id="radio" value="radio" />
  36.     </label></td>
  37.      <td width="124"><? echo $fila['op_des']; ?></td>
  38.   </tr>
  39.    <tr>
  40.     <td><label>
  41.       <input type="submit" name="btnAnterior" id="btnAnterior" value="Anterior" />
  42.     </label></td>
  43.     <td>&nbsp;</td>
  44.     <td><input name="btnSiguiente" type="submit" value="Siguiente"  /></td>
  45.   </tr>
  46. </table>
  47. </form>
  48.  
  49. </body>
  50. </html>
__________________
Hospedaje Web al mejor costo!