Por ahora tengo esto:
Código PHP:
<?php require_once "phpuploader/include_phpuploader.php" ?>
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
Form - Start uploading manually
</title>
<link href="demo.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function doStart()
{
var uploadobj = document.getElementById('myuploader');
if (uploadobj.getqueuecount() > 0)
{
uploadobj.startupload();
}
else
{
alert("Please browse files for upload");
}
}
</script>
</head>
<body>
<div class="demo">
<h2>Start uploading manually</h2>
<P>Only <span style="color:red">MP3</span> allowed</p>
<!-- do not need enctype="multipart/form-data" -->
<form id="form1" method="POST" action="subida.php">
<input type="text" id="titulo" name="titulo"><br>
<?php
$uploader=new PhpUploader();
$uploader->MaxSizeKB=1024000;
$uploader->Name="myuploader";
$uploader->InsertText="Select multiple files (Max 10M)";
$uploader->SaveDirectory="savefiles";
$uploader->AllowedFileExtensions="*.mp3";
$uploader->MultipleFilesUpload=true;
$uploader->ManualStartUpload=true;
$uploader->Render();
?>
<br /><br /><br />
<input type="submit" id="submitbutton" onclick="doStart();return false;" value="Dale!">
</form>
<br/><br/><br/>
<?php
$fileguidlist=@$_POST["myuploader"];
if($fileguidlist)
{
$guidlist=explode("/",$fileguidlist);
echo("<div style='font-family:Fixedsys;'>");
echo("Uploaded ");
echo(count($guidlist));
echo(" files:");
echo("</div>");
echo("<hr/>");
foreach($guidlist as $fileguid)
{
$mvcfile=$uploader->GetUploadedFile($fileguid);
if($mvcfile)
{
echo("<div style='font-family:Fixedsys;border-bottom:dashed 1px gray;padding:6px;'>");
echo("FileName: ");
echo($mvcfile->FileName);
echo("<br/>FileSize: ");
echo($mvcfile->FileSize." b");
// echo("<br/>FilePath: ");
// echo($mvcfile->FilePath);
echo("</div>");
//Moves the uploaded file to a new location.
//$mvcfile->MoveTo("/uploads");
//Copys the uploaded file to a new location.
//$mvcfile->CopyTo("/uploads");
//Deletes this instance.
//$mvcfile->Delete();
}
}
}
?>
</div>
</body>
</html>
Código PHP:
<?php
$titulo = $_POST["titulo"];
$qry = "INSERT INTO songs ( titulo ) VALUES
('$titulo')";
mysql_connect("localhost","root","password") or die("No se pudo conectar a la base de datos");
mysql_select_db("canciones");
mysql_query($qry) or die("Query: $qry <br />Error: ".mysql_error());
mysql_close();
echo "Yeaaaah"
?>
como lo hago para almacenar tambien la url? o lo que sea que haga falta para que luego yo con un buscador encuentre la cancion y al clicar (usando algun reproductor flash) me la reproduzca??.
Gracias de antemano.