Php folder xplorer

Description

avec ce script, vous pouvez explorer un dossier distant de la machine et downloader les file via un ftp.
utile si vous partagez en ftp des fichiers mais que vous voulez eviter aux gens d'aller sur le ftp, ils passent par une page web.

Updates ::
- gere toutes les extentions de toutes les longeurs
- separe les dossier des fichiers via un tableau.

Source / Exemple :


<?php
/*
Le dossier du fichier mais par le ftp ::
le chemin doit se finir par un /
si tu doit mettre un \, alors double-le ('\' = '\\'), sinon, ya bug! 

  • /
$ftpdir = "ftp://monserver.com/"; $dirs = "d:\\"; // chemin par defaut des fichier du ftp...rappel => en php, '\' = '\\' if ($diridW=="") { $dirid = $dirs; //$diridW = $dirs; $dirW = ""; } else { $dirid .= $dirs; $dirid .= $diridW; $dirid .= "\\"; $dirid = STR_REPLACE("\\\\\\\\","\\\\",$dirid); $dirW .= $diridW; $dirW .= "\\"; $dirW = STR_REPLACE("\\\\\\\\","\\\\",$dirW); $dirW = STR_REPLACE("\\","/",$dirW); } /* print(" <font color=red> dirs :: $dirs<br> dirid :: $dirid<br> dirW :: $dirW<br> diridW :: $diridW </font> ");
  • /
?> <html> <head> <title>Liste de mes mp3's</title> <style type="text/css"> .text1 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #CCCCCC} .text2 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #999999} .text3 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000} .titre1 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF} A { color: #cccccc; line-height : 13pt; font-weight: bold; text-decoration: none; } A:hover { color: #336699; line-height : 13pt; font-weight: bold; text-decoration: none; } A.nav { color: #ffffff; font-size : 11px; font-family: Arial, Helvetica, sans-serif; text-decoration: none; } A.nav:hover { color: #000000; font-size : 11px; font-family: Arial, Helvetica, sans-serif; text-decoration: none; } A.whitebg { color: #000000; line-height : 13pt; font-weight: bold; text-decoration: none; } A.whitebg:hover { color: #336699; line-height : 13pt; font-weight: bold; text-decoration: none; } A.mail { color: #000000; line-height : 12pt; text-decoration: none; } A.mail:hover { color: #336699; line-height : 12pt; text-decoration: none; } </style> </head> <?php $ip = getenv("REMOTE_ADDR"); ?> <body bgcolor="#000000" vlink="#000000" alink="#000000" link="#000000" text=#ffffff> <table width="700" border="0" cellspacing="0" cellpadding="0" align="center"> <tr valign="bottom"> <td> </td> </tr> </table> <table width=100% bgcolor=#336699> <tr> <th align=left> :: </th> <th> Liste de mes mp3's !! </th> <th align=right> :: </th> </tr> </table> <center> <br> <table border=0> <tr> <th bgcolor=#336699> ..:: Navigation ::.. </th> </tr> <tr> <th bgcolor=#ffffff> <a href="javascript:history.go(-1);"><img src=picture/download.png border=no alt="Retours"></a> <a href=index.php><img src=picture/kfm_home.png border=no alt="Retours a l'index"></a> <a href=mailto:cajl@9online.fr><img src=picture/kmail3.png border=no alt="Contacter l'admin"></a> </th> </tr> <tr> <th bgcolor=#336699 align=left> <?php echo "<a href='index.php' class=nav title=\"retours a l'index\">index</a>"; $dirW2 = STR_REPLACE("/"," / ",$diridW); $tok = strtok($dirW2,"/"); while ($tok) { $tok = STR_REPLACE("/","",$tok); $ltok .= $tok; $ltok = STR_REPLACE(" ","/",$ltok); echo " > <a href='?diridW=$ltok' class=nav title='retours au dossier $tok'>$tok</a>"; $tok = strtok("/"); } ?> </th> </tr> </table> <br> </center> <table width="701" border="0" cellspacing="0" cellpadding="1" align="center"> <tr> <td nowrap valign="top" class=titre1> <img src="/images_easyphp/carre_gris.gif" width="8" height="8">&nbsp; Liste des fichiers &nbsp;: </td> <td valign="top" width="100%" class=text1> <table> <? $rep=opendir($dirid); while ($file = readdir($rep)) { if($file != '.' && $file != '..' && $file !='picture' && $file !='' && $file != 'index.php'){ $path_parts = pathinfo("/$dirW$file"); if ($path_parts["extension"] != ""){ } else { echo "<tr>\n<th align=left><img src=picture/red_folder.png border=no>&nbsp;</th>"; echo "<th align=left><a href=\"?diridW=$dirW$file\" class=text1>$file</a></th></tr>"; echo ""; } } } closedir($rep); $rep=opendir($dirid); while ($file = readdir($rep)) { if($file != '.' && $file != '..' && $file !='picture' && $file !='' && $file != 'index.php'){ $path_parts = pathinfo("/$dirW$file"); if ($path_parts["extension"] != ""){ echo "<tr>\n<th align=left><img src=picture/file.png border=no>&nbsp;\n</th>\n"; echo "<th align=left>\n<a href=\"$ftpdir$dirW$file\" target=_blank class=text1>$file</a>\n</th>\n</tr>\n"; echo ""; } } } closedir($rep); clearstatcache(); ?> <b> </b> </table> </td> </tr> </table> <br> <center> <table> <tr> <th bgcolor=#336699> :: Credits :: </th> </tr> <tr> <th bgcolor=#ffffff align=left class=text3> Created By BlackWizzard [<a href=mailto:blackwizzard@fuckwindows.com class=mail title="un petit mail?">Contact</a>] </th> </tr> </table> </center> </body> </html>

Conclusion :


recuperez les images du zip mais remplacez le code de index.php du zip par celui exposé ici.
Dans le zip, C l'ancienne version du code!

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.