<? /* --------------------------------------------------------------------------------------------------------------- # ~~> Manipulador de Scripts v1.0 ~~> Finalidade: Organizar meus pr�prios scripts ~~> Fun��es: Deletar Scripts, Ver Fonte, Organiz�-los; :: Como Utilizar? Selecione um diret�rio para armazenar seus scripts e deixar o resto com este arquivo :] :: O meu por exemplo, � o diret�rio: "der", como configurado abaixo :: Criado por Anderson Dad�rio :: D�vidas? e-mail: andersonmvd@hotmail.com || PS: N�o adiciono no MSN! Grato, Anderson # --------------------------------------------------------------------------------------------------------------- */ $diretorio = "der"; // Diret�rio de scripts em seu localhost ?> <html> <head> <title>�ndice - Manipulador de Scripts _/ Anderson Dad�rio \_</title> </head> <body link=forestgreen alink=blue vlink=forestgreen> <script language='Javascript'> function tabela(id) { if(document.getElementById(id).style.display == 'none'){ document.getElementById(id).style.display = '' } else { document.getElementById(id).style.display = 'none' } } </script> <div align=center> <font face=verdana size=2> <?php # --------------------------------------------------------------------------------------------------------------- # function color($string){ $string = str_replace("</","<font color='blue'></</font>",$string); $string = str_replace("/>","<font color='blue'>/></font>",$string); $string = str_replace("<","<font color='blue'><</font>",$string); $string = str_replace(">","<font color='blue'>></font>",$string); $string = str_replace("?<font color='blue'>></font>","<font color='red'>?></font>",$string); $string = str_replace("<font color='blue'><</font>?php","<font color='red'><?php</font>",$string); $string = str_replace("<font color='blue'><</font>?","<font color='red'><?</font>",$string); $string = str_replace("xhtml","<font color='forestgreen'>xhtml</font>",$string); $string = str_replace("html","<font color='forestgreen'>html</font>",$string); $string = str_replace("else","<font color='darkblue'>else</font>",$string); $string = str_replace("if","<font color='brown'>if</font>",$string); return nl2br($string); } # --------------------------------------------------------------------------------------------------------------- # if(isset($_GET['deletar'])) { if(@unlink($_GET['deletar'])){ echo "<table style=\"font-family:verdana;font-size:13px\"><tr bgcolor='#FCCFFF'><td>O arquivo \"<b>".$_GET['deletar']."</b>\" foi deletado!</td></tr></table><br>"; } else { echo "<table style=\"font-family:verdana;font-size:13px\"><tr bgcolor='#FCCFFF'><td>Houveram erros ao tentar deletar \"<b>".$_GET['deletar']."</b>\"</td></tr></table><br>"; } } elseif(isset($_GET['fonte']) and file_exists($_GET['fonte'])) { $fileCT = @file($_GET['fonte']) or die("<font face='verdana' size='2'><center>Endere�o requisitado n�o existe"); echo "<table align=center width='100%' style='border: 1px solid black;font-family:verdana;font-size:12px;'>"; echo "<tr><td align=center style='color:forestgreen' bgcolor='#EDEDED'>Fonte: <a href='".$_GET['fonte']."'><b>".$_GET['fonte']."</b></a></td></tr>"; foreach($fileCT as $linha => $valor) { $conteudo = htmlspecialchars($valor); echo "<tr><td>".color($conteudo)."</td></tr>"; } echo "<tr><td align=center style='color:darkblue' bgcolor='#EDEDED'><a href='".$_SERVER['PHP_SELF']."'>Voltar</a></td></tr>"; echo "</table>"; exit; } ?> Atalhos Principais <a href="javascript:tabela('tb1')">#</a><br><br> <table align='center' id='tb1' style='font-family:verdana;font-size:12px;border: 1px solid orange;' width='50%'> <!-- ------------------------------------------------------------------------------------------------ --> <!-- Estes s�o setados manualmente :P --> <tr bgcolor="#EDEDED"><td align='center'><a href='der/despertador.php'>Despertador</a></td></tr> <tr bgcolor="#EDEDED"><td align='center'><a href='der/porto.php'>Porto</a></td></tr> <tr bgcolor="#EDEDED"><td align='center'><a href='web/ftp.class.php'>FTP Conector</a></td></tr> <tr bgcolor="#EDEDED"><td align='center'><a href='web/agenda.php'>Agenda MySql</a></td></tr> <!-- ------------------------------------------------------------------------------------------------ --> </table> <br>Pasta '<b><?=$diretorio?></b>' <a href="javascript:tabela('tb2')">#</a><br><br> <table align='center' id='tb2' style='font-family:verdana;font-size:12px;border: 1px solid forestgreen' width='50%'> <?php if ($handle = opendir($diretorio)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<tr bgcolor='#EDEDED'> <td><a href='".$diretorio."/".$file."'>$file</a></td> <td width='5%'><a href='?deletar=".$diretorio."/".$file."' onclick=\"return confirm('Deseja deletar ".$file."?')\"><img src='web/Img/del.gif' border=0></a></td> <td width='5%'><a href='?fonte=".$diretorio."/".$file."'><img src='web/Img/info.gif' alt='Ver Fonte' border=0></a></td> </tr>\n"; } } closedir($handle); } ?> </table> <br>Outros diret�rios <a href="javascript:tabela('tb3')">#</a><br><br> <table align='center' id='tb3' style='font-family:verdana;font-size:12px;border: 1px solid blue' width='50%'> <?php if ($handle = opendir(".")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && is_dir($file) && $file != "der") { echo "<tr bgcolor='#EDEDED'><td align='center'><a href='".$file."'>$file</a></td></tr>"; } } closedir($handle); } ?> </table> </div> </body> </html>