Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/05/2006, 10:07
augusto_jaramil
 
Fecha de Ingreso: junio-2004
Ubicación: Ciudad de Panama
Mensajes: 551
Antigüedad: 19 años, 10 meses
Puntos: 8
No me canciona este script (Primiparo)

Jovenes aun, como les ha ido?

Es que estoy acomodando un script encontrado en
http://www.dhtmlgoodies.com/index.ht..._client_lookup
y no me ha querido cancionar. La idea es que al capturar el Id de un cliente me traiga algunos datos de la Base de Datos (Que pena la falta de redundancia). El caso es que no esta llegando a el script PHP que se encarga de hacer la consulta. El codigo HTML es el siguiente (Simplificado):

Código PHP:
/************************************************************************************************************
    (C) www.dhtmlgoodies.com, November 2005
    
    This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.    
    
    Terms of use:
    You are free to use this script as long as the copyright message is kept intact. However, you may not
    redistribute, sell or repost it without our permission.
    
    Thank you!
    
    www.dhtmlgoodies.com
    Alf Magne Kalleland
    
    ************************************************************************************************************/    
    
var ajax = new sack();
    var 
currentClientID=false;

    function 
getClientData()
    {
        var 
clientId document.getElementById("nit").value.replace(/[^0-9]/g,'');
        if(
clientId.length && clientId!=currentClientID) {
            
currentClientID clientId;
[
b]            ajax.requestFile 'getClient.php?getClientId='+clientId;    [/b]// Specifying which file to get
            
ajax.onCompletion showClientData();    // Specify function that will be executed after file has been found
            
ajax.runAJAX();        // Execute AJAX function            
        
}
        
    }
    
    function 
showClientData()
    {
        var 
formObj document.forms['clientForm'];
        eval(
ajax.response);
    }
    
    function 
initFormEvents()
    {
        
document.getElementById('nit').onblur getClientData();
        
document.getElementById('nit').focus();
    }
    
    
    
window.onload initFormEvents;

    
</script>
</head>

<body>
    <form name="clientForm" action="clientes.htm" method="post">
        <legend>Informacion de Clientes</legend>
        <table>
            <tr>
                <td>Nit :</td>
                <td><input name="nit" id="nit" size="15" maxlength="14"></td>
            </tr>
            <tr>
                <td>Nombre :</td>
                <td><input name="nombre" id="nombre" size="15" maxlength="14"></td>
            </tr>
            <tr>
                <td>Direccion :</td>
                <td><input name="direccion" id="direccion" size="15" maxlength="14"></td>
            </tr>
            <tr>
                <td>Telefono :</td>
                <td><input name="telefono" id="telefono" size="15" maxlength="14"></td>
            </tr>
            <tr>
                <td>Ciudad :</td>
                <td><input name="ciudad" id="ciudad" size="15" maxlength="14"></td>
            </tr>
            <tr>
                <td>Clase :</td>
                <td><input name="clase" id="clase" size="15" maxlength="14"></td>
            </tr>
            <tr>
                <td>Estado :</td>
                <td><input name="estado" id="estado" size="15" maxlength="14"></td>
            </tr>
        </table>    
    </form>
</body>
</html> 
Y el codigo PHP (getClient.php) es el siguiente

Código PHP:
<?php

  session_start
();
/* Replace the data in these two lines with data for your db connection */
  
include ('lee_base.php');
  include (
'configuracion/abrirbd.php');

echo 
"AQUI LLEGUE<hr>"print_r($_GET); flush(); ob_flush(); die;

if(isset(
$_GET['getClientId'])) {  
  
$nit $_GET['getClientId'];
  
$inf lee_todo("Select nombre, direccion, telefono, ciudad, clase, estado from nits where nit=$nit");
  if(
count($inf) > 0) {
    echo 
"formObj.nombre.value = '".$inf["nombre"]."';\n";    
    echo 
"formObj.direccion.value = '".$inf["direccion"]."';\n";    
    echo 
"formObj.telefono.value = '".$inf["telefono"]."';\n";    
    echo 
"formObj.ciudad.value = '".$inf["ciudad"]."';\n";    
    echo 
"formObj.clase.value = '".$inf["clase"]."';\n";    
    echo 
"formObj.estado.value = '".$inf["estado"]."';\n";    
    
  } else {
    echo 
"formObj.nombre.value = '';\n";    
    echo 
"formObj.direccion.value = '';\n";    
    echo 
"formObj.telefono.value = '';\n";    
    echo 
"formObj.ciudad.value = '';\n";    
    echo 
"formObj.clase.value = '';\n";    
    echo 
"formObj.estado.value = '';\n";      
  }    
}
?>
Como les digo, no me ejecuta el codigo PHP. Por que?

Agradezco de antemano su Colaboracion

Un Cordial Saludo