09/03/2015, 20:32
|
| | Fecha de Ingreso: marzo-2009
Mensajes: 117
Antigüedad: 15 años, 8 meses Puntos: 2 | |
Respuesta: Upload php mysql (mp3 y buscador) este es mi codigo file.php pero no me descarga las canciones amigo
<?php include('config.php');
if (isset($_GET['id']))
{
$id = $_GET['id'];
$query = mysql_query("SELECT * FROM archivos WHERE id='$id'");
while($row = mysql_fetch_assoc($query))
{
$enlace = $row['ID'];
$name = $row['Name'];
$url = $row['Url'];
$tamaño = $row['Tam'];
}
}
else
{
header('Location: 404.php');
}
function bytes2English($filesize)
{
if ($filesize<1048676)
RETURN number_format($filesize/1024,1) . " KB";
if ($filesize>=1048576 && $filesize<1073741824)
RETURN number_format($filesize/1048576,1) . " MB";
if ($filesize>=1073741824 && $filesize<1099511627776)
RETURN number_format($filesize/1073741824,2) . " GB";
if ($filesize>=1099511627776)
RETURN number_format($filesize/1099511627776,2) . " TB";
if ($filesize>=1125899906842624) //Currently, PB won't show due to PHP limitations
RETURN number_format($filesize/1125899906842624,3) . " PB";
}
?>
<html>
<head>
<title><?php echo $name ?> | Deckso Gamez</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>/css/tabla.css">
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>/css/style.css">
<Script src="http://code.jquery.com/jquery-2.1.1-rc2.min.js" ></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script src="script.js"></script>
</head>
<body>
<center>
<fieldset style="border: 1px solid #C8C8C8;width: 500;margin: 10;background: #FFF;">
<form style="margin:10px;" action="search.php" method="get">
<input style="width:350px; height:30px; text-align:center; font-family:fantasy" placeholder="Nombre de cancion o artista" type="text" name="id" id="buscar">
<input style="width:100px" type="submit" class="btn btn-success" value="Buscar">
</form>
</fieldset>
</center>
<div class="container-main">
aki
<h3><?php echo $name ?> <p><a href="download.php?file=$url">descargar</a></p> </h3>
<p><?php echo bytes2english($tamaño); ?> </p>
<object width="100%" height="24" type="application/x-shockwave-flash" data="<?php echo $base ?>player/player.swf">
<param name="movie" value="<?php echo $base ?>player/player.swf" />
<param name="flashvars" value="file=upload/<?php echo $url ?>?theme=light&autostart=true&screencolor=000000&b ackcolor=000000&frontcolor=ffffff&lightcolor=0774a f">
<param name="wmode" value="transparent" />
<param name="allowfullscreen" value="true"/>
<param name="allowScriptAccess" value="always" />
</object><br />
<center><a href="<?php echo $base ?>download?file=<?php echo $enlace ?>"><input type="image" src="<?php echo $base ?>imagenes/descarga-boton.png" /></a></center>
</div>
<p><a href="download.php?file=$url">prueba</a></p>
<center><table class="tbl1" cellpadding="2" cellspacing="1" width="500">
<tbody><tr class="hdr"><td colspan="2"><a href="/">Archivos subidos</a></td></tr>
<?php
$query = mysql_query("SELECT * FROM archivos ORDER BY ID DESC LIMIT 10");
while($row = mysql_fetch_assoc($query))
{
$id = $row['ID'];
$name = $row['Name'];
$tam = $row['Tam'];
$mb = bytes2english($tam);
echo "<tr><td><a href='file.php?id=$id'>$name</a></td><td width='1%' nowrap='' align='right'> $mb </td></tr>";
}
?>
</tbody></table></center>
</body>
</html> |