Ver Mensaje Individual
  #15 (permalink)  
Antiguo 10/07/2010, 00:48
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Superposicion de variables

No necesitás nada de eso, sólo trabajar prolijamente. Un ejemplo:
Código PHP:
<?php if(isset($_POST['test']))die($_POST['test']); ?>
<!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>Documento sin título</title>
<script>
function http(){
    if(typeof window.XMLHttpRequest!='undefined'){
        return new XMLHttpRequest();    
    }else{
        try{
            return new ActiveXObject('Microsoft.XMLHTTP');
        }catch(e){
            alert('Su navegador no soporta AJAX');
            return false;
        }    
    }    
}

function request(url,callback,params){
    var H=new http();
    if(!H)return;
    H.open('post',url+'?'+Math.random(),true);
    H.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    H.onreadystatechange=function(){
        if(H.readyState==4){
            callback(H.responseText);
            H.onreadystatechange=function(){}
            H.abort();
            H=null;
        }
    }
    var p='';
    for(var i in params){
        p+='&'+i+'='+escape(params[i]);    
    }
    H.send(p);
}
function c(v,id){
    document.getElementById(id).innerHTML=v;
}
onload=function(){
    request('<?php echo basename($_SERVER['PHP_SELF']) ?>',function(v){c(v,'d1');},{'test':'valor 1'});
    request('<?php echo basename($_SERVER['PHP_SELF']) ?>',function(v){c(v,'d2');},{'test':'valor 2'});
    request('<?php echo basename($_SERVER['PHP_SELF']) ?>',function(v){c(v,'d3');},{'test':'valor 3'});
    request('<?php echo basename($_SERVER['PHP_SELF']) ?>',function(v){c(v,'d4');},{'test':'valor 4'});
    request('<?php echo basename($_SERVER['PHP_SELF']) ?>',function(v){c(v,'d5');},{'test':'valor 5'});
}
</script>
</head>

<body>
<div id="d1"></div>
<div id="d2"></div>
<div id="d3"></div>
<div id="d4"></div>
<div id="d5"></div>
</body>
</html>