简体   繁体   中英

Listing Directories in PHP

I have an < iframe > and when I "click" to one of the files .html that I show with this list it was appearing in this < iframe >. How can I do that? I need to change the src that has the < iframe >. Now the only thing that it does is to open to a new page. Thank you.

<iframe id="probando" src="<?php echo $url; ?>" scrolling="auto" height="700" width="800" marginheight="0" marginwidth="0" name="probando"></iframe>

Since I can do that it changes the src that has the giving click. the only thing that it does is to open to a new . Thank you. This is my code.

$directorioInicial = "./";    
$rep = opendir($directorioInicial);     
while ($arc = readdir($rep)) {       

if ($arc != '..' && $arc != '.' && $arc != '') {

    echo "<a href=" . $directorioInicial . "/" . $arc . " target='_blank'>" . $arc . "</a><br />";  
}
}
closedir($rep);      
clearstatcache();  

If i understand you correctly, i think you need to change the target of the link to "_self" instead of _blank. See this page for more info

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM