Ver Mensaje Individual
  #7 (permalink)  
Antiguo 31/03/2009, 21:32
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, 8 meses
Puntos: 834
Respuesta: saber las paginas en las que navega un iframe

Esta es una aproximación usando el ejemplo del primer enlace. Tendrás que trabajarla un poco:
Código PHP:
<!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>ejemplo</title>
<
script>
function $(
id){
    return 
document.getElementById(id);    
}
var 
asignar=setInterval(function(){
    if($(
'p')){
        if(
window.ActiveXObject){
            $(
'p').onreadystatechange=function(){
                if($(
'p').readyState=='complete'){
                       
taguear();
                }
            }
            
clearInterval(asignar);
            return;
        }
        $(
'p').onload=function(){
            
taguear();
        }
        
clearInterval(asignar);
    }
},
10);
function 
taguear(){
    
document.getElementById('p').style.visibility='visible';
    var 
docIframe=document.getElementById('p').contentWindow.document || document.getElementById('p').contentDocument;
    var 
enlaces=docIframe.getElementsByTagName('a');
    for(var 
i=0;enlaces[i];i++){
        (function(
enlace){
            
enlace.onclick=function(){
                
enlace.target="_self";
                
parent.document.getElementById('log').innerHTML=enlace.href;
                
document.getElementById('p').src='proxy.php?url='+escape(enlace.href);
                
enlace.href='#';
                return 
false;
            }
        })(
enlaces[i]);
    }
}
</script>
</head>

<body>
<iframe style="visibility:hidden" id="p" width="500" height="500" src="proxy.php?url=http://www.forosdelweb.com"></iframe>
<div id="log"></div>
</body>
</html> 
Y proxy.php:
Código PHP:
<base href="<?php $d=parse_url($_GET['url'],PHP_URL_HOST); echo $d ?>" />
<?php 
echo file_get_contents($_GET['url']);
?>

Última edición por Panino5001; 31/03/2009 a las 22:33 Razón: Mejora Explorer