19 lines
452 B
PHP
19 lines
452 B
PHP
|
<?php
|
||
|
header('Content-type: audio/mpeg');
|
||
|
|
||
|
mysql_connect('mysql5-2.bdb', 'crystalynet', 'pentium4');
|
||
|
mysql_select_db('crystalynet');
|
||
|
mysql_query('SET NAMES UTF8');
|
||
|
|
||
|
if (isset($_GET['id'])) {
|
||
|
$premier = mysql_fetch_row(mysql_query('SELECT titre FROM mp3 WHERE id = '. $_GET['id']));
|
||
|
}
|
||
|
else {
|
||
|
$premier = mysql_fetch_row(mysql_query('SELECT titre FROM mp3 ORDER BY RAND() LIMIT 1'));
|
||
|
}
|
||
|
|
||
|
header('Location: mp3/'. $premier[0] .'.mp3');
|
||
|
|
||
|
mysql_close();
|
||
|
?>
|