Ir para conteúdo
Fórum Script Brasil

onsguitar

Membros
  • Total de itens

    5
  • Registro em

  • Última visita

Sobre onsguitar

onsguitar's Achievements

0

Reputação

  1. Saudação ;D Estou com um probleminha com um sistema de gerenciar arquivos todas as funçoes estão funcionando direitinho exceto a função para EXCLUIR arquivo não consigo achar o problema o sistema esta no servidor vocês podem dar uma olhada e dar uma sugestão ? http://phrafa.freehostia.com/gerenciar/ vlw obrigadoo
  2. onsguitar

    botão deletar

    os arquivos aprarecem por um sistema de upload uso outro script para listar os arquivos recebidos e queria nesse script que lista colocar a opção para deletar valeu
  3. onsguitar

    botão deletar

    Galera preciso de uma Ajuda Tenho um Script PHP para listar arquivos de um diretorio ele mostra o nome do arquivo a extenção e tem a opção para download mais precisava de colocar a opção para deletar arquivo em cada arquivo o codico esta abaixo <?php function varSet($VAR) { return isset($_GET[$VAR]) ? $_GET[$VAR] : ""; } $action = varSet("action"); $pasta = base64_decode(varSet("pasta")); //Lista dos arquivos que não serão listados $denyFiles = array(".htaccess","thumbs.db"); if ($action == "download") { $file = base64_decode(varSet("file")); header("Content-disposition: attachment; filename=\"".basename($file)."\""); readfile(".$file"); exit; } ?> <!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>Listagem de Arquivos</title> <style type="text/css"> body { font:11px Verdana, Arial, Helvetica, sans-serif; padding:0px; margin:0px; } a { text-decoration:none; color:#003366; } a:hover { color:#0099CC } .row1 { background-color:#F7F7F7 } .row2 { background-color:#EBEBEB } .rowOver { background-color:#C7DCFC } .extCell { font-weight:bold } </style> <script language="javascript" type="text/javascript"> function over(Obj) { nClass = Obj.className Obj.className = "rowOver" Obj.onmouseout = function() { Obj.className = nClass } } </script> </head> <body> <?php if ($action == ""): $fdir = "./$pasta"; chdir($fdir); $dir = opendir("."); while ($file = readdir($dir)) if (is_dir($file)) $dirs[] = $file; else $files[] = $file; $row = 2; ?> <table width="700" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="50px;"> <div align="center">Abra ou fa&ccedil;a o Download dos Arquivos Abaixo</div></td> </tr> <tr> <td height="50px;"><strong>Exibindo:</strong> Arquivos <?php echo empty($pasta) ? "" : $pasta; ?></td> </tr> </table> <table width="700" border="0" align="center" cellpadding="0" cellspacing="0"> <tr style="font-weight:bold"> <td width="55" height="20">&nbsp;</td> <td width="204">Nome</td> <td width="130">Tamanho</td> <td width="316">A&ccedil;&otilde;es</td> </tr> <?php if ($pasta != ""): ?> <tr class="row<?php echo $row; ?>" onmouseover="over(this)"> <td align="center" width="55" height="20" class="extCell">[DIR]</td> <td><a href="?pasta=<?php echo base64_encode(substr("$pasta",0,strrpos($pasta,"/"))); ?>">..</a></td> <td>--</td> <td>&nbsp;</td> </tr> <?php endif; ?> <?php if (is_array($dirs)) : sort($dirs); foreach ($dirs as $nome): if ($nome == ".." || $nome == ".") continue; if ($row == 2) $row = 1; else $row = 2; ?> <tr class="row<?php echo $row; ?>" onmouseover="over(this)"> <td align="center" width="55" height="20" class="extCell">[DIR]</td> <td><a href="?pasta=<?php echo base64_encode("$pasta/$nome"); ?>"><?php echo $nome; ?></a></td> <td>--</td> <td>&nbsp;</td> </tr> <?php endforeach; endif; ?> <?php if (is_array($files)): sort($files); foreach ($files as $nome): if (in_array(strtolower($nome),$denyFiles)) continue; if ($row == 2) $row = 1; else $row = 2; $tamanho = filesize("./$nome"); $info = pathinfo("./$nome"); ?> <tr class="row<?php echo $row; ?>" onmouseover="over(this)"> <td align="center" width="55" height="20" class="extCell">[<?php echo strtoupper($info["extension"]); ?>]</td> <td> <a href="?action=download&file=<?php echo base64_encode("$pasta/$nome"); ?>"><?php echo $nome; ?></a> </td> <td><?php echo $tamanho > 1048576 ? round($tamanho/1048576,2)." Mb" : round($tamanho/1024,2)." Kb"; ?></td> <td>&nbsp;</td> </tr> <?php endforeach; endif; ?> </table> <?php endif; ?> </body> </html> <?php closedir($dir); ?> Desde já agradeçoo aos amigos desse forum
  4. onsguitar

    Listar Diretorio

    esse é o problema o script funciona perfeitamente se estiver dentro da pasta arquivo eu queria deixa-lo na pasta htm um nivel antes da pasta ARQUIVOS
  5. onsguitar

    Listar Diretorio

    IAE Galera ! to com um probleminha. Estou com um código PHP para Listar todos os arquivos de um diretorio FTP até aki OK o problema é que ele só LISTA os arquivos do Diretorio que ele esta Exemplo DIRETORIO: HTM --> Listar.php foto.jpg ARQUIVOS: atas.pdf foto01.jpg Eu queria que ele listasse os arquivos do Diretorio ARQUIVOS Eis o Código <?php function varSet($VAR) { return isset($_GET[$VAR]) ? $_GET[$VAR] : ""; } $action = varSet("action"); $pasta = base64_decode(varSet("pasta")); //Lista dos arquivos que não serão listados $denyFiles = array(".htaccess","thumbs.db"); if ($action == "download") { $file = base64_decode(varSet("file")); header("Content-disposition: attachment; filename=\"".basename($file)."\""); readfile(".$file"); exit; } ?> <!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>Listagem de Arquivos</title> <style type="text/css"> body { font:11px Verdana, Arial, Helvetica, sans-serif; padding:0px; margin:0px; } a { text-decoration:none; color:#003366; } a:hover { color:#0099CC } .row1 { background-color:#F7F7F7 } .row2 { background-color:#EBEBEB } .rowOver { background-color:#C7DCFC } .extCell { font-weight:bold } </style> &lt;script language="javascript" type="text/javascript"> function over(Obj) { nClass = Obj.className Obj.className = "rowOver" Obj.onmouseout = function() { Obj.className = nClass } } </script> </head> <body> <?php if ($action == ""): $fdir = "./$pasta"; chdir($fdir); $dir = opendir("."); while ($file = readdir($dir)) if (is_dir($file)) $dirs[] = $file; else $files[] = $file; $row = 2; ?> <table width="700" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="50px;"> <div align="center">Abra ou faça o Download dos Arquivos Abaixo</div></td> </tr> <tr> <td height="50px;"><strong>Exibindo:</strong> Arquivos <?php echo empty($pasta) ? "" : $pasta; ?></td> </tr> </table> <table width="700" border="0" align="center" cellpadding="0" cellspacing="0"> <tr style="font-weight:bold"> <td width="55" height="20"> </td> <td width="204">Nome</td> <td width="130">Tamanho</td> <td width="316">Ações</td> </tr> <?php if ($pasta != ""): ?> <tr class="row<?php echo $row; ?>" onmouseover="over(this)"> <td align="center" width="55" height="20" class="extCell">[DIR]</td> <td><a href="?pasta=<?php echo base64_encode(substr("$pasta",0,strrpos($pasta,"/"))); ?>">..</a></td> <td>--</td> <td> </td> </tr> <?php endif; ?> <?php if (is_array($dirs)) : sort($dirs); foreach ($dirs as $nome): if ($nome == ".." || $nome == ".") continue; if ($row == 2) $row = 1; else $row = 2; ?> <tr class="row<?php echo $row; ?>" onmouseover="over(this)"> <td align="center" width="55" height="20" class="extCell">[DIR]</td> <td><a href="?pasta=<?php echo base64_encode("$pasta/$nome"); ?>"><?php echo $nome; ?></a></td> <td>--</td> <td> </td> </tr> <?php endforeach; endif; ?> <?php if (is_array($files)): sort($files); foreach ($files as $nome): if (in_array(strtolower($nome),$denyFiles)) continue; if ($row == 2) $row = 1; else $row = 2; $tamanho = filesize("./$nome"); $info = pathinfo("./$nome"); ?> <tr class="row<?php echo $row; ?>" onmouseover="over(this)"> <td align="center" width="55" height="20" class="extCell">[<?php echo strtoupper($info["extension"]); ?>]</td> <td> <a href="?action=download&file=<?php echo base64_encode("$pasta/$nome"); ?>"><?php echo $nome; ?></a> </td> <td><?php echo $tamanho > 1048576 ? round($tamanho/1048576,2)." Mb" : round($tamanho/1024,2)." Kb"; ?></td> <td> </td> </tr> <?php endforeach; endif; ?> </table> <?php endif; ?> <p align="center"><a href="../index.php">Enviar mais Arquivos</a></p> <p align="center"><a href="../../index.html">Home</a></p> </body> </html> <?php closedir($dir); ?>
×
×
  • Criar Novo...