Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/06/2011, 08:49
rs1964
 
Fecha de Ingreso: noviembre-2009
Ubicación: valencia
Mensajes: 7
Antigüedad: 14 años, 6 meses
Puntos: 0
error 500 (Internal Server Error)

tengo un campo select que se crea leyendo los datos de una base de datos mysql (hasta aqui todo bien), y una vez seleccionado el valor, deberia buscar y extraer los datos, pero obtengo el siguiente error: error 500 (Internal Server Error) . no entiendo a que es debido. el codigo es:

file: apar_del.php

Código PHP:
<?php
require '../php/paginaHtml.class.php';
require_once 
'../php/Db.class.php';
require_once 
'../php/Conf.class.php';
require 
'../php/funciones.class.php';

$_Db Db::getInstance();
$_pH = new paginaHtml();
$_func = new funciones();
$_pH->head_admin();
?>
.
.
.
.
Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. // funcion ajax para refrescar la pagina
  3. function showApartamento(str)
  4. {
  5.       if (str=="")
  6.      {
  7.          document.getElementById("txtHint").innerHTML="";
  8.          return;
  9.       }
  10.       if (window.XMLHttpRequest)
  11.       {// code for IE7+, Firefox, Chrome, Opera, Safari
  12.           xmlhttp=new XMLHttpRequest();
  13.       }
  14.       else
  15.       {// code for IE6, IE5
  16.           xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  17.       }
  18.       xmlhttp.onreadystatechange=function()
  19.       {
  20.           if (xmlhttp.readyState==4 && xmlhttp.status==200)
  21.              {
  22.                   document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
  23.              }
  24.        }
  25.        xmlhttp.open("GET","../php/visualiza_datos.php?apart="+str,true);
  26.        xmlhttp.send();
  27.  }
  28. </script>
.
.
.
.
.
.
<div id="formulario">
<form action="apar_del.php" method="post">
<label for="apartamento">Apartamento</label>
<select name="apartamento" class="formulario" onchange="showApartamento(this.value)">
<option selected="selected">Seleccione un apartamento...</option>
Código PHP:
Ver original
  1. <?php
  2.                 $_sql = "SELECT nombre FROM apartamentos ORDER BY nombre ASC";
  3.                 $_stmt = $_Db->ejecutar($_sql);
  4.                 while ($_fila = $_Db->obtener_fila($_stmt, 0))
  5.                 {
  6.                     echo"<option>" . $_fila['nombre'] . "</option>";
  7.                 }
  8.                 ?>
</select>
</form>
</div>




file: visualiza_datos.php

Código PHP:
Ver original
  1. <?php
  2.         require_once 'Db.class.php';
  3.         require_once 'Conf.class.php';
  4.        
  5.         $_apartamento = $_GET["apart"];
  6.        
  7.         $_Db = Db::getInstance();
  8.        
  9.         $_sql = "SELECT * FROM apartamentos WHERE nombre = '".$_apartamento."'";
  10.         $_stmt = $_Db->ejecutar($_sql);
  11.         $_object = $_bd->fetch_object($_stmt);
  12.        
  13.         echo'<div class="campo">';
  14.         echo'   <label for="direccion" class="etiq">direccion</label>';
  15.         echo'   <input name="direccion" id="direccion" type="text" size="40" value="'.$_object->direccion.'"/>';
  16.         echo'</div>';
  17.         echo'<div class="campo">';
  18.         echo'   <label for="zona" class="etiq">zona</label>';
  19.         echo'   <input name="zona" id="zona" type="text" size="40" value="'.$_object->zona.'" />';
  20.         echo'</div>';
  21.         echo'<div class="campo">';
  22. .
  23. .
  24. .
  25. .
  26. ?>