Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/12/2012, 07:05
Avatar de trofserpiente
trofserpiente
 
Fecha de Ingreso: julio-2012
Ubicación: Lerida
Mensajes: 220
Antigüedad: 11 años, 10 meses
Puntos: 1
Exclamación buscador que no funciona en ie

buenos días, lo que sucede es que tengo un buscador simple que al ir escribiendo me va mostrando los resultados pero tiene un gran problema ya que en todos los navegadores funciona bien pero en ie no muestra los resultados, cuenta con 4 archivos

1)
buscador.php

Código PHP:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<style type="text/css">
/*@import url("../../css/alternate.css");*/
</style>
<script src="../../js/ajax.js" language="javascript" type="text/javascript"></script>
</head>

<body>
<?php
session_start
();

if(
$_SESSION['autenticado']!==1){
header("location:../../user/login.php");
}else{
$_SESSION['Id_user'];

    
$fechaGuardada $_SESSION["ultimoAcceso"]; 
    
$ahora date("Y-n-j H:i:s"); 
    
$tiempo_transcurrido = (strtotime($ahora)-strtotime($fechaGuardada)); 

     if(
$tiempo_transcurrido >= 720)
         { 
      
session_destroy(); // destruyo la sesión 
      
header("location:../../user/login.php");  
         }else { 
           
$_SESSION["ultimoAcceso"] = $ahora
   }

?>

<div id="stylized" class="myform">
  <form  id="form" name="form">
<div class="caja">
<input type="text" id="texto" class="input" size="40" onKeyUp="Buscar();"/>
</div>
<img src="../../img/AB/A_Boluga.png" width="216" height="116" alt="Arrocera Boluga">
<div class="resultados" id="resultados"></div>
</form>
<div class="spacer"></div>
</div>
<?php
}
?>
</body>
</html>

2)
query.php


Código PHP:
<?php

 
include("../../libreria/server.php");
 
 
$conexAmysql_connect("$host","$user","$pass")
    or die(
"No se pudo realizar la conexion");
 
$conexBmysql_select_db("$db",$conexA)
    or die(
"ERROR con la base de datos");

function 
Extraer($q){
    
    
$consulta=mysql_query("SELECT * FROM proveedor WHERE Provedor LIKE '%$q%'");
    if (
mysql_num_rows($consulta)==0){
          echo 
"No se Encontrarón Resultados";
        }else{
                  echo 
'<table width="800px" border="1" cellspacing="0" cellpadding="0">
                  <tr> 
                  <th><center>Identificación Proveedor</center></th>
                  <th><center>Nombre del Proveedor</center></th>
                  <th width="10px"><center>Modificar</center></th>
                  <th width="10px"><center>Ver</center></th>
                  </tr>'
;
              
$color='#FF0000';
              
$i=0;
    
              while(
$fila=mysql_fetch_object($consulta)){
                
$i++; 
                 if((
$i%2)==0){ 
                  
$color '#FFFFFF'
                        }else{ 
                      
$color '#E6F2E1'
                          }   
              
?>
                   
                <tr>
                  <td bgcolor="<?php echo $color?>" class="l_menuda"><?php echo $fila->Identificacion_pro?></td>
                  <td bgcolor="<?php echo $color?>" class="l_menuda"><?php echo $fila->Provedor;?></td>
                  <td><center>
                <form action="informacion_pv.php" method="get">
                <input type="hidden" value="<?php echo $fila->Identificacion_pro;?>" name="mensaje"/>
                <input type="submit" name="modificar" value="Ver" id="botones" />
                </form></center>
                 </td>
                 <td><center>
                <form action="modificar_pv.php" method="post">
                <input type="hidden" value="<?php echo $fila->Identificacion_pro;?>" name="cod_pv2"/>
                <input type="submit" name="modificar" value="modificar" id="botones" />
                </form><center>
                 </td>
                </tr>
                  
                  <?php
                    
                  
}
                  echo 
'</table>';
            }
    }

?>

3)
procesar.php

Código PHP:
<?php
include("query.php");

$q=$_GET['q'];
if(
$q==""){
    echo 
"Ingresa Datos Para Buscar !Gracias¡";
 }else{
Extraer($q);
}


?>
4)
ajax.js

function Buscador(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}

function Buscar() {
var Texto = document.getElementById('texto').value;
var Resultados = document.getElementById('resultados');
ajax = Buscador();
ajax.open("GET","procesar.php?q="+Texto);
ajax.onreadystatechange = function() {
if (ajax.readyState == 4) {
Resultados.innerHTML = ajax.responseText;
}
}
ajax.send(null)

}


estos son los archivos, lo que a mi me parece que pasa es que no ejecuta el .js no se ustedes que son las personas idóneas para poderme colaborar.

gracias de antemano
__________________
Luis Alfonso Cruz Valbuena
[email protected]