note 42522 deleted from ref.dir by sniper

From: Date: Fri, 16 Dec 2005 00:00:59 +0000
Subject: note 42522 deleted from ref.dir by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-100264@lists.php.net to get a copy of this message
Note Submitter: david ---- a little juiced up version of turgon64´s script. before the $moverse was getting very long if you where doing a lot of moving around in directorys and also i was unable to open files. also, now you´re not able to move above the specified path <?php $path = "./"; if (strrpos($moverse,'..')) { $moverse = str_replace('/..','',$moverse); $moverse = substr($moverse,0,strrpos($moverse,'/')); } if($moverse) $moverse = $moverse."/"; echo $moverse.'<br>'; $handle=opendir($path.$moverse); while ($file = readdir($handle)) { if(is_dir($path.$moverse.$file) && $file != ".") { if ($file == ".." && $moverse == "") { } else { echo "<a href='?moverse=".$moverse.$file."'>".$file."</a><br>"; } } else if ($file != ".") { echo "<a href='".$path.$moverse.$file."'>".$file."</a><br>"; } } ?>

« previous php.notes (#100264) next »