Foros del Web » Programando para Internet » PHP »

ftp con php

Estas en el tema de ftp con php en el foro de PHP en Foros del Web. Hola, necesito me ayuden a crear un script php que simule un ftp en la web. Hice un script que trata de simularme eso pero ...
  #1 (permalink)  
Antiguo 08/01/2005, 10:16
 
Fecha de Ingreso: enero-2005
Ubicación: Cienfuegos
Mensajes: 1
Antigüedad: 19 años, 3 meses
Puntos: 0
ftp con php

Hola, necesito me ayuden a crear un script php que simule un ftp en la web.
Hice un script que trata de simularme eso pero me da muchos errores y no sé como corregirlo,
Por favor si alguien me ayuda seria de gran importancia para mi
el codigo del script es este:

<title></title>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="412" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="128" valign="top">
<table width="412" height="107" border="0" align="center" cellpadding="0" cellspacing="0" class="barra">
<!--DWLayoutTable-->
<tr valign="middle" class="barra">
<td height="26" colspan="4"><img src="images/dir.gif" width="20" height="20" align="left">
<?php echo $HTTP_GET_VARS['dir']; ?> <br>
<hr size="1" noshade> </td>
</tr>
<tr class="texto">
<td width="26" height="19" bgcolor="#F2F2F2">&nbsp;</td>
<th width="175" align="left" bgcolor="#F2F2F2">Nombre</th>
<th width="107" align="center" bgcolor="#F2F2F2">
<div align="right">Tama&ntilde;o</div></th>
<th width="104" align="center" bgcolor="#F2F2F2">
<div align="center">Descarga</div></th>
</tr>
<?php
if(isset($HTTP_GET_VARS['dir']))
{
$dir = $HTTP_GET_VARS['dir'];
$directory = dir("/home/www/nuevo/".$dir."/");
}
else
{
$directory = dir("/home/www/nuevo/down/");
}
?>
<tr class="texto">
<td height="18" align="center">
<?php
if ($dir)
{
echo '<a href="?dir='.substr($dir, 0, strrpos($dir, "/")).'">'
.'<img src="images/folder1.gif" width="20" height="22" border="0"></a>';
} else
{
echo "&nbsp;";
}
?>
</td>
<td colspan="3" align="left">
<?php
if ($dir)
{
echo "<a href="?dir'.substr($dir, 0, strrpos($dir, "\")).'">
..</a>";
}
else
{
echo "&nbsp;";
}
?>
</td>
</tr>
<?php
while($filename=$directory->read())
{
//if (is_readable($filename)) {
if ($filename != "." && $filename != "..")
{
if (is_file($directory->path.$filename))
{
//echo filesize($directory->path.$filename) / 1024."<br>"
?>
<tr class="texto">
<td height="22" align="center"><a href="http://www.cfg.jovenclub.cu/nuevo/down<?=$dir.'/'.$filename?>"><img src="images/des.gif" width="21" height="21" border="0"></a></td>
<td align="left"><a href="http://www.cfg.jovenclub.cu/nuevo/down<?=$dir.'/'.$filename?>">
<?=$filename?>
</a></td>
<td align="right"><img src="images/zip.gif" width="11" height="13">
<?php echo number_format(filesize($directory->path.$filename)/1024, 1)." Kb"; ?></td>
<td align="right"><div align="center"><a href="http://www.cfg.jovenclub.cu/nuevo/down<?=$dir.'/'.$filename?>">Descargar</a></div></td>
</tr>
<?php
}
if (is_dir($directory->path.$filename))
{
?>
<tr class="texto">
<td height="22" align="center"><a href="down.php?dir=<?=$dir."/".$filename?>"><img src="images/folder.gif" width="20" height="19" border="0"></a></td>
<td align="left"><a href="down.php?dir=<?=$dir."/".$filename?>">
<?=$filename?>
</a></td>
<td align="right">
<?php
$directory_in = dir($directory->path.$filename."/");
$elements = 0;
while($filename_in=$directory_in->read())
{
if ($filename_in != "." && $filename_in != "..")
{
$elements++;
}
}
$directory_in->close();
echo $elements." Elementos";
?>
</td>
<td align="right">&nbsp;</td>
</tr>
<?php
}
}
}
$directory->close();
?>
</table>
<hr width="98%" size="1">
</table>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:58.