como cria um play pause buscando registro de musica em um banco de dad
eae galera desenvolvi um sistema de upload de arquivo q ao enviar o arquivo, ele faz um registro no banco de dados e em outra pagina ele mostra o resultado com o nome do arquivo e um link para dowload q acompanha um contador
ou seja ele mostra assim na tabela
artista | nome da musica | contador | download e um botao de play e pause gostaria que a musica fosse tocada ao cicar no botao play e que ela para se ao clicar no botão pause
esse sistema eu criei com o plugin developer tool box do Dreamweaver
07/06/2016 Artista Nome da Música Contador Download Selo e Alata Part. Mc Vertinho Lei Seca 2
Mr. Sony e Love Latinha No Chão 2
segue o codico da pagina
<?php require_once('Connections/arquivos.php'); ?>
<?php
// Load the tNG classes
require_once('includes/tng/tNG.inc.php');
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$maxRows_musicas = 1000;
$pageNum_musicas = 0;
if (isset($_GET['pageNum_musicas'])) {
$pageNum_musicas = $_GET['pageNum_musicas'];
}
$startRow_musicas = $pageNum_musicas * $maxRows_musicas;
mysql_select_db($database_arquivos, $arquivos);
$query_musicas = "SELECT * FROM arquivos ORDER BY id DESC";
$query_limit_musicas = sprintf("%s LIMIT %d, %d", $query_musicas, $startRow_musicas, $maxRows_musicas);
$musicas = mysql_query($query_limit_musicas, $arquivos) or die(mysql_error());
$row_musicas = mysql_fetch_assoc($musicas);
if (isset($_GET['totalRows_musicas'])) {
$totalRows_musicas = $_GET['totalRows_musicas'];
} else {
$all_musicas = mysql_query($query_musicas);
$totalRows_musicas = mysql_num_rows($all_musicas);
}
$totalPages_musicas = ceil($totalRows_musicas/$maxRows_musicas)-1;
// Download File downloadObj1
$downloadObj1 = new tNG_Download("", "KT_download1");
$downloadObj1->setConnection($conn_arquivos, "arquivos");// Download Counter
$downloadObj1->setTable("arquivos");
$downloadObj1->setPrimaryKey("id", "NUMERIC_TYPE", "{musicas.id}");
$downloadObj1->setCounterField("contador");// Execute
$downloadObj1->setFolder("arquivos_musicas");
$downloadObj1->setRenameRule("{musicas.arquivo}");
$downloadObj1->Execute();
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Bregas</title>
<link href="css/small.css" rel="stylesheet" media="screen and (min-width:0px) and (max-width:360px)" type="text/css" />
<link href="css/medium.css" rel="stylesheet" media="screen and (min-width:1000px)" type="text/css" />
<link href="css/large.css" rel="stylesheet" media="screen and (min-width:1350px)" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/musica.css">
<script>
audio = document.getElementById('audio');
function play(){
audio.play();
}
function pause(){
audio.pause();
}
</script>
<body>
<div id="conteudo">
<div id="publicidade">
</div>
<div class="area1">
<h1>MÚSICAS CONEXÃO BREGA FUNK</h1>
<h2>7 de Junho de 2016</h2>
<h3> Site Atualizado, com 49 músicas novas! Tem Brega Ramantico, Brega funk e logo mais teremos funk Proibidão, madley e Ostentação e muito mais, curtam os sons dos Mc's<p> Cego, Menor, Leozinho, Sheldon, Tocha, Mc Skilo, Troia e Diversas bandas de Bregas Romanticos como as Bandas A Favorita, Bateu A Quimica, Cillada, Pank Brega, Boa Toda e muito mais.<p/> Corre pra baixar que é tudo gratis e sem complicação para Baixar e so Clicar e Pronto sua Musica sera baixada sem precisar ir para outros sites Confira... #DiretoriaConexaoBregaFunk</h3>
<div class="musicas">
<br /><br />
<div class="buscar">
</div>
<table width="820" class="tabela1" border="">
<tbody>
<tr>
<th colspan="5" bgcolor="#044151" scope="col"><h2>07/06/2016</h2></th>
</tr>
<tr>
<td width="230" bgcolor="#e0dfdf"><h4>Artista</h4></td>
<td width="266" bgcolor="#e0dfdf"><h4>Nome da Música</h4></td>
<td width="80" bgcolor="#e0dfdf"><h5>Contador</h5></td>
<td width="60" bgcolor="#e0dfdf"><h4>Download</h4></td>
<td width="81" bgcolor="#e0dfdf"><h4> </h4></td>
</tr>
<?php do { ?>
<tr>
<td> <h4> <?php echo $row_musicas['artista']; ?> </h4> </td>
<td> <h4> <?php echo $row_musicas['musica']; ?> </h4> </td>
<td> <h5> <?php echo $row_musicas['contador']; ?> </h5> </td>
<td><a href="<?php echo $downloadObj1->getDownloadLink(); ?>"><img src="img top/Dow.png"width="26" height="25"></a></td>
<td>
<div>
<a href="#" onClick="play()"><img src="img top/play.png" width="25" height="25" /></a>
<a href="#" onClick="pause()"><img src="img top/pause.png" width="25" height="25" /></a>
</div> </td>
</tr>
<?php
} while ($row_musicas = mysql_fetch_assoc($musicas)); ?>
</table>
</div>
<div class="top10">
<h2>Top's do Momento </h2>
<h5>Clique na imagem para reproduzir ou parar a musica!</h5>
<li> <h3>1</h3> <a href="arquivos_musicas/A Favorita - Mente Fria - DJ JALL THE BEST OF PE - Acessem WwW.ConexaoBregaFunk.Net.mp3" onClick="play()"> <img src="img top/tocha.jpg"> </a> <h4>A Minha Fiel</h4> <h6> Mc Tocha</h6> </li>
<li> <h3>2</h3> <a href="#"> <img src="img top/dada.jpg"> </a> <h4>Senta e Contrai</h4> <h6> Dada Boladão</h6> </li>
<li> <h3>3</h3><img src="img top/japão.jpg" > <h4> Quando Tc esse Solinho </h4> <h6> Mc Japão</h6> </li>
<li> <h3>4</h3><img src="img top/playback.JPG" > <h4> Não Olhe Pra Trás</h4> <h6>Playback </h6> </li>
<li> <h3>5</h3><img src="img top/sedutora.png" > <h4> Displicente</h4> <h6> Sedutora </h6> </li>
<li> <h3>6</h3><img src="img top/Mc Leozinho 01.jpg" > <h4>Pimentinha </h4> <h6>Mc Leozinho</h6> </li>
<li> <h3>7</h3><img src="img top/mc shedon.jpg" > <h4> O Chefe Chegou</h4> <h6>Sheldon Ferrer </h6> </li>
<li> <h3>8</h3><img src="img top/boa toda.jpg" > <h4> Boa Toda </h4> <h6>Diario</h6> </li>
<li> <h3>9</h3><img src="img top/menor e tocha.jpg" > <h4> Devassa</h4> <h6>Mc Tocha e Mc Menor </h6> </li>
<li> <h3>10</h3><img src="img top/bateu a quimica.jpg" > <h4>To Fora</h4> <h6>Banda Bateu A Quimica </h6> </li>
</div>
</div>
<div id="rodape">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="#">Musicas</a></li>
<li><a href="#">Noticias </a></li>
<li><a href="#">Videos</a></li>
</ul>
<div class="copy"> <h1>© Copyright 2016 || Conexão Brega Funk || - Todos os Direitos Reservados - Site no ár desde 07/06/2016 - Desenvolvedor - <a href="[http://www.jhdisigner.com.br](http://www.jhdisigner.com.br)">JH Disigner</a></h1> </div>
</div>
</div>
</body>
</html>
<?php
mysql_free_result($musicas);
?>
segue a pagina do meu site
Discussão (0)
Carregando comentários...