Система за песни

Автор: miro_94

Здравейте.Напоследък получавам доста лични съобщения във форума и доста хора ми пишат по скайп за системата за слушане на
песни, за това пускам този урок.

Структура на основната папка/
бд.sql
addsong.php
index.php
admin.php
login.php
conn.php
playsong.php
broken.php
player.swf

бд.sql

CREATE TABLE `songs_cat` (
`id` int(4) NOT NULL auto_increment,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `songs_cat` VALUES (1, 'Áàëàäè');
INSERT INTO `songs_cat` VALUES (2, 'Club');
INSERT INTO `songs_cat` VALUES (3, 'Dance');
INSERT INTO `songs_cat` VALUES (4, 'Electronic');
INSERT INTO `songs_cat` VALUES (5, 'Gothic');
INSERT INTO `songs_cat` VALUES (6, 'Hip-Hop');
INSERT INTO `songs_cat` VALUES (7, 'JazZ');
INSERT INTO `songs_cat` VALUES (8, 'Latin');
INSERT INTO `songs_cat` VALUES (9, 'Pop');
INSERT INTO `songs_cat` VALUES (10, 'Psychedelic');
INSERT INTO `songs_cat` VALUES (11, 'R&B');
INSERT INTO `songs_cat` VALUES (12, 'Reggae');
INSERT INTO `songs_cat` VALUES (13, 'Rock');
INSERT INTO `songs_cat` VALUES (14, 'Techno');
INSERT INTO `songs_cat` VALUES (15, 'Íàðîäíè');
INSERT INTO `songs_cat` VALUES (16, 'Êþ÷åöè');
INSERT INTO `songs_cat` VALUES (17, 'Õîðà');
INSERT INTO `songs_cat` VALUES (18, 'Drum''n''Bass');
INSERT INTO `songs_cat` VALUES (19, 'Retro');
INSERT INTO `songs_cat` VALUES (20, 'Ãðúöêî');
INSERT INTO `songs_cat` VALUES (21, 'House');
INSERT INTO `songs_cat` VALUES (22, 'Jungle');
INSERT INTO `songs_cat` VALUES (23, 'Metal');
INSERT INTO `songs_cat` VALUES (24, 'Ïîï Ôîëê');
INSERT INTO `songs_cat` VALUES (25, 'Punk');
INSERT INTO `songs_cat` VALUES (26, 'Rap');
INSERT INTO `songs_cat` VALUES (27, 'Reggaeton');
INSERT INTO `songs_cat` VALUES (28, 'Ñðúáñêî');
INSERT INTO `songs_cat` VALUES (29, 'Trance');
INSERT INTO `songs_cat` VALUES (30, 'Äåòñêè');
INSERT INTO `songs_cat` VALUES (31, 'Äðóãè');


CREATE TABLE `songs` (
`id` int(4) NOT NULL auto_increment,
`author` varchar(255) NOT NULL,
`artist` varchar(255) NOT NULL,
`title` varchar(255) NOT NULL,
`path` varchar(255) NOT NULL,
`year` varchar(255) NOT NULL,
`album` varchar(255) NOT NULL,
`size` varchar(255) NOT NULL,
`cat` varchar(255) NOT NULL,
`date` varchar(255) NOT NULL,
`broken` varchar(255) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

addsong.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Песни</title>
<style type="text/css">
<!--
.txt {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
border: 1px solid #000000;
}
.btn {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
height: auto;
width: 55px;
border: 1px solid #000000;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
text-decoration: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
}
#table {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
border: 1px solid #000000;
}
.boxtext {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #000000;
text-decoration: underline;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
color: #000000;
}
a:hover {
color: #333333;
}
-->
</style>
</head>

<body>
<div align="center" class="boxtext"><b>Добавяне на песен</b><br />
</div>
<form id="form2" name="form2" method="post" action="">
<table width="250" border="0" align="center" cellpadding="1" cellspacing="1" id="table">
<tr>
<td>Изпълнител</td>
<td><strong>:</strong></td>
<td align="center"><input name="artist" type="text" class="txt" id="artist" size="30" /></td>
</tr>
<tr>
<td align="left">Песен</td>
<td align="center"><strong>:</strong></td>
<td align="center"><input name="title" type="text" class="txt" id="title" size="30"></td>
</tr>
<tr>
<td align="left">Албум</td>
<td align="center"><strong>:</strong></td>
<td align="center"><input name="album" type="text" class="txt" id="album" size="30"></td>
</tr>
<tr>
<td align="left">Размер</td>
<td align="center"><strong>:</strong></td>
<td align="center"><input name="size" type="text" class="txt" id="size" size="30"></td>
</tr>
<tr>
<td align="left">Година</td>
<td align="center"><strong>:</strong></td>
<td align="center"><input name="year" type="text" class="txt" id="year" size="30"></td>
</tr>
<tr>
<td align="left">Линк</td>
<td align="center"><strong>:</strong></td>
<td align="center"><input name="path" type="text" class="txt" id="path" size="30"></td>
</tr>
<tr>
<td align="left">Добавил</td>
<td align="center"><strong>:</strong></td>
<td align="center"><input name="author" type="text" class="txt" id="author" size="30" /></td>
</tr>
<tr>
<td colspan="3" align="center"><select name="cat" class="txt" id="cat">
<option>Изберете категория</option>
<?php
include("conn.php");
$r = mysql_query("SELECT * FROM songs_cat");
while($row = mysql_fetch_array($r)){
$cat .= "<option value=\"$row[id]\" class=\"bottom\">$row[value]</option>";
}
echo $cat;
?>
</select></td>
</tr>
<tr>
<td colspan="3" align="center"><input name="submit" type="submit" class="btn" id="button" value="Изпрати" />
<input name="button2" type="reset" class="btn" value="Изчисти" /></td>
</tr>
</table>
</form>
<?php

if($_POST['submit']){
if($_POST['title'] == ""){
echo "<script type=\"text/javascript\">
alert('Не сте написали заглавие и/или съдържание на обявата.Моля направете го.');
</script>";}
elseif($_POST['cat'] == "Изберете категория" || $_POST['pic'] == "http://"){
echo "<script type=\"text/javascript\">
alert('Не сте избрали категория и/или снимка на обявата.Моля направете го.');
</script>";}
else {
$date = date("d.m.Y");
$sql = "INSERT INTO `songs` (`id`, `author`, `artist`, `title`, `path`, `year`, `album`, `size`, `cat`, `date`) VALUES (NULL, '$_POST[author]', '$_POST[artist]', '$_POST[title]', '$_POST[path]', '$_POST[year]', '$_POST[album]', '$_POST[size] mb', '$_POST[cat]', '$date');";
$result = mysql_query($sql) or die(mysql_error());
}
}
?>
</body>
</html>

index.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Песни</title>
<style type="text/css">
<!--
.txt {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
border: 1px solid #000000;
}
.btn {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
height: auto;
width: 55px;
border: 1px solid #000000;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
text-decoration: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
}
#table {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
border: 1px solid #000000;
}
.boxtext {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #000000;
text-decoration: underline;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
color: #000000;
}
a:hover {
color: #333333;
}
-->
</style>
</head>

<body>
<table width="375" border="0" align="center" cellpadding="1" cellspacing="1" id="table">
<tr>
<td><div class="boxtext">Стилове</div>
<?php
include("conn.php");
$gener = $_GET['gener'];
$cat = mysql_query("SELECT * FROM `songs_cat`");
while($row = mysql_fetch_array($cat)){
$our = mysql_query("SELECT count(id) as total FROM songs WHERE cat=$row[id]");
while($raw=mysql_fetch_array($our)){
$total=$raw['total'];
}
echo "<a href=\"?gener=$row[id]\">$row[value] ($total) </a> | ";
}
?>
<br></td>
</tr>
<tr>
<td><div class="boxtext">
<?php if($gener == ""){
echo "Добавени песни";
} else {
$cat = mysql_query("SELECT * FROM `songs_cat` WHERE `id`='$gener'");
$category = mysql_fetch_array($cat);
$id=$category['id'];
$genername = $category['value'];
echo "Песни в стил $genername";
}

?>
</div>
<?php
if($_GET['gener']){
// Отбележете по колко резултата да се показват на страница
$pp = "50";
// изберета таблиза която искате да покажете
$table = "songs";

$total = mysql_result(mysql_query("SELECT COUNT(*) FROM $table"),0);
$numofpages = $total / $pp;
if (!isset($_GET['page'])) {
$page = 1;
}
else {
$page = $_GET['page'];
}
$limitvalue = $page * $pp - ($pp);

/* покажете записите, в този случай аз показвам само [username] */
$query = "SELECT * FROM `$table` WHERE `cat`='$gener' ORDER BY `id` DESC LIMIT $limitvalue, $pp";
$result = mysql_query($query);
while($row=mysql_fetch_array($result))
{
echo "» <a href=\"playsong.php?id=$row[id]\">$row[artist] - $row[title]</a><br>";
}
function per_page($link, $offset) {
global $numofpages, $page;
$numofpages = round($numofpages);

$pagesstart = round($page-$offset);
$pagesend = round($page+$offset);

/* показване на стрелки « за предишна страница */
if ($page != "1" && round($numofpages) != "0") {
echo str_replace("%page", round($page-1), '<a href="'.$link.'"><font face="Trebuchet MS">«</font></a> ');
}

for($i = 1; $i <= $numofpages; $i++) {
if ($pagesstart <= $i && $pagesend >= $i) {
if ($i == $page) {
echo "<b>[$i]</b> ";
}
else {
echo str_replace("%page", "$i", '<a href="'.$link.'">'.$i.'</a> '); //номерация на страниците
}
}
}
if (round($numofpages) == "0") {
echo "[$i]";
}
/* показване на стрелки » за следваща страница */
if ($page != round($numofpages) && round($numofpages) != "0") {
echo str_replace("%page", round($page+1), '<a href="'.$link.'"><font face="Trebuchet MS">»</font></a>');
}
}

/* показване на общия брой страници и избор на страница */
echo '<br>';
echo 'Общо страници: '.round($numofpages).'<br>';

per_page("?page=%page", "5");
} else {
// Отбележете по колко резултата да се показват на страница
$pp = "50";
// изберета таблиза която искате да покажете
$table = "songs";

$total = mysql_result(mysql_query("SELECT COUNT(*) FROM $table"),0);
$numofpages = $total / $pp;
if (!isset($_GET['page'])) {
$page = 1;
}
else {
$page = $_GET['page'];
}
$limitvalue = $page * $pp - ($pp);

/* покажете записите, в този случай аз показвам само [username] */
$sql = "SELECT * FROM `$table` ORDER BY id DESC LIMIT $limitvalue, $pp";
$result = mysql_query($sql);
while($row=mysql_fetch_array($result))
{
echo "» <a href=\"playsong.php?id=$row[id]\">$row[artist] - $row[title]</a><br>";
}
function per_page($link, $offset) {
global $numofpages, $page;
$numofpages = round($numofpages);

$pagesstart = round($page-$offset);
$pagesend = round($page+$offset);

/* показване на стрелки « за предишна страница */
if ($page != "1" && round($numofpages) != "0") {
echo str_replace("%page", round($page-1), '<a href="'.$link.'"><font face="Trebuchet MS">«</font></a> ');
}

for($i = 1; $i <= $numofpages; $i++) {
if ($pagesstart <= $i && $pagesend >= $i) {
if ($i == $page) {
echo "<b>[$i]</b> ";
}
else {
echo str_replace("%page", "$i", '<a href="'.$link.'">'.$i.'</a> '); //номерация на страниците
}
}
}
if (round($numofpages) == "0") {
echo "[$i]";
}
/* показване на стрелки » за следваща страница */
if ($page != round($numofpages) && round($numofpages) != "0") {
echo str_replace("%page", round($page+1), '<a href="'.$link.'"><font face="Trebuchet MS">»</font></a>');
}
}

/* показване на общия брой страници и избор на страница */
echo '<br>';
echo 'Общо страници: '.round($numofpages).'<br>';

per_page("?page=%page", "5");
}
?></td>
</tr>
</table>
</body>
</html>

admin.php

<?php
$potrebitel= $HTTP_POST_VARS['potrebitel'];//Защитаваме панела с потребител и пароля
$pas= $HTTP_POST_VARS['pas'];
if ($potrebitel!='admin' || $pas!='admin'){
echo "Вие нямате достъп до тази страница";
exit;
}
else {
?>
<?php include("conn.php");//Конекция към Базата Данни ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Песни</title>
<style type="text/css">
<!--
.txt {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
border: 1px solid #000000;
}
.btn {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
height: auto;
width: 55px;
border: 1px solid #000000;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
text-decoration: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
}
#table {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
border: 1px solid #000000;
}
.table {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
border: 1px solid #000000;
}
.boxtext {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #000000;
text-decoration: underline;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
color: #000000;
}
a:hover {
color: #333333;
}
-->
</style>
</head>

<body>
<table width="450" border="0" align="center" cellpadding="1" cellspacing="1" class="table" id="broken">
<tr>
<td align="center"><a href="#songs">Добавени песни</a> | <a href="#categoryes">Категории</a> | <a href="#broken">Неработещи линкове</a></td>
</tr>
<tr>
<td><div id="songs"><a name="songs"></a><br>
<table border="0" align="center" cellpadding="1" cellspacing="1" class="table" id="songs">
<tr>
<td width="20" align="center" class="bottom">ID</td>
<td width="100" align="center" class="bottom">Автор</td>
<td width="200" align="center" class="bottom">Изпълнител - Песен</td>
<td width="90" align="center" class="bottom">Категория</td>
</tr><?php
$r = mysql_query("SELECT * FROM songs") or die(mysql_error());

while($row=mysql_fetch_array($r))
{
$cat = mysql_query("SELECT * FROM `songs_cat` WHERE `id`='$row[cat]'");
$raw = mysql_fetch_array($cat);
$genername = $raw['value'];
$tut_all .=
"<tr>
<td width=\"20\" align=\"center\">$row[id]</td>
<td width=\"55\" align=\"center\">$row[author]</td>
<td width=\"189\" align=\"center\">$row[artist] - $row[title]</td>
<td width=\"63\" align=\"center\">$genername</td>
</tr>";
}
echo $tut_all;
?>
</table>
<br></div>
<br>
<div id="categoryes"><a name="categoryes"></a>
<form action="" method="post">
<div align="center">Добавяне на категория :
<input name="songs_cat" type="text" class="txt" id="songs_cat" />

<input name="submit5" type="submit" class="btn" id="submit5" value="Запиши" />
</div>
</form>
<div align="center">
<?php
if($_POST['submit5']){
$sql4 = "INSERT INTO `songs_cat` (`id`, `value`) VALUES ('NULL', '$_POST[songs_cat]');";
$result4 = mysql_query($sql4) or die(mysql_error());
if($result4 == true){
echo "Успешно добавена категория!";
}
}

?>
<br>
<br>
<strong>Добавени категории:</strong>
</div>
<table width="300" border="0" align="center" cellpadding="1" cellspacing="1" class="table" id="categoryes"><a name="categoryes"></a>
<tr>
<td align="center" class="bottom">ID</td>
<td align="center" class="bottom">Категория</td>
<td align="center" class="bottom">DEL</td>
</tr><?php
$r = mysql_query("SELECT * FROM songs_cat") or die(mysql_error());
while($row=mysql_fetch_array($r))
{
$songs_cats .=
"<tr>
<td align=\"center\" class=\"bottom\">$row[id]</td>
<td align=\"center\" class=\"bottom\">$row[value]</td>
<td align=\"center\" class=\"bottom\"><a href=\"del4.php?id=$row[id]\">[X]</a></td>
</tr>";
}

echo "$songs_cats";
?>
</table>
</div>
<br>
<div id="broken"><a name="broken"></a><br>
<table border="0" align="center" cellpadding="1" cellspacing="1" class="table">
<tr>
<td width="25" align="center" class="bottom">№</td>
<td width="355" align="center" class="bottom">Песен</td>
</tr>
<?php
$r = mysql_query("SELECT * FROM `songs`");
while($row = mysql_fetch_array($r)){
if($row['broken'] == 1){
echo "
<tr>
<td align=\"center\" class=\"bottom\">$row[id]</td>
<td align=\"left\" class=\"bottom\">$row[artist] - $row[title]</td>
</tr>";}
else {
echo " <tr>
<td align=\"center\" class=\"bottom\">$row[id]</td>
<td align=\"left\" class=\"bottom\">$row[artist] - $row[title]</td>
<td class=\"bottom\">Работи!</td>
</tr>";
}
}
?>
</table>
<br></div>
</td>
</tr>
</table>
</body>
</html><?php } ?>

logi.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><::miro_94::></title>
</head>

<body>
<form action="admin.php" method="post"><br>
<br>
<table border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td>Потребител</td>
<td>:</td>
<td><input type="text" name="potrebitel" /></td>
</tr>
<tr>
<td>Парола</td>
<td>:</td>
<td><input type="password" name="pas" /></td>
</tr>
<tr>
<td colspan="3"><input type="submit" value="ВХОД"></td>
</tr>
</table>
</body>
</html>

conn.php

<?php
$host = "localhost";
$user = "root";
$pass = "";
$db = "songs";

mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
?>

playsong.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Песни</title>
<style type="text/css">
<!--
.txt {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
border: 1px solid #000000;
}
.btn {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
height: auto;
width: 55px;
border: 1px solid #000000;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
text-decoration: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
}
#table {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
border: 1px solid #000000;
}
.table {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
border: 1px solid #000000;
}
.boxtext {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #000000;
text-decoration: underline;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
color: #000000;
}
a:hover {
color: #333333;
}
-->
</style>
</head>

<body>
<?php
include("conn.php");
$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM `songs` WHERE `id`='$id'");
$row = mysql_fetch_array($sql);
?>
<table width="395" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
<tr>
<td colspan="2" class="lfhead"><?php echo "$row[artist] - $row[title]"; ?></td>
</tr>
<tr>
<td width="100">Стил :</td>
<td width="200"><?php
$cat = mysql_query("SELECT * FROM `songs_cat` WHERE `id`='$row[cat]'");
$raw = mysql_fetch_array($cat);
$genername = $raw['value'];
echo "<a href=\"songs.php?gener=$row[cat]\" title=\"Песни в стил $genername\">$genername</a>";
?></td>
</tr>
<tr>
<td>Добавена на :</td>
<td><?php echo $row['date']; ?></td>
</tr>
<tr>
<td>Добавена от:</td>
<td><?php echo $row['author']; ?></td>
</tr>
<tr>
<td>Албум :</td>
<td><?php echo $row['album']; ?></td>
</tr>
<tr>
<td>Размер :</td>
<td><?php echo $row['size']; ?></td>
</tr>
<tr>
<td>Година :</td>
<td align="left"><?php echo $row['year']; ?></td>
</tr>
<tr>
<td colspan="2" align="center"><object type="application/x-shockwave-flash" data="player.swf?son=<?php echo $row['path']; ?>" height="20" width="200">
<param name="movie" value="player.swf?son=<?php echo $row['path']; ?>">
</object></td>
</tr>
<tr>
<td colspan="2" align="center"><a href="broken.php?id=<?php echo $row['id']; ?>" title="Докладвайте за песента <?php echo "$row[artist] - $row[title]"; ?>">Неработещ линк</a> | <a href="<?php echo $row['path']; ?>" target="_blank" title="Изтеглете песента <?php echo "$row[artist] - $row[title]"; ?>">Изтегли</a></td>
</tr>
</table>
</body>
</html>

broken.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Песни</title>
<style type="text/css">
<!--
.txt {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
border: 1px solid #000000;
}
.btn {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
height: auto;
width: 55px;
border: 1px solid #000000;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
text-decoration: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
}
#table {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
border: 1px solid #000000;
}
.table {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
border: 1px solid #000000;
}
.boxtext {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #000000;
text-decoration: underline;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
color: #000000;
}
a:hover {
color: #333333;
}
-->
</style>
</head>

<body>
<?php
include("conn.php");
$id = $_GET['id'];
$update = mysql_query("UPDATE `songs` SET `broken` = '1' WHERE `songs`.`id` = '$id'");
if($update == true){
$r = "<div align=\center\" class=\"boxtext\">Вие успешно докладвахте за тази песен.След преглед от администратор тя ще бъде изтрита и/или заместана и/или оправена.Благодарим Ви!</div>";
} elseif($update == false){
$r = "<div align=\center\" class=\"boxtext\">Вашето докладване е неуспешно.Свържете се с администратор!</div>";
} else {
$r = "";
}
echo $r;
?>
</body>
</html>

Урокът е авторски и забранявам неговото преписване в други Български сайтове!

Вашият коментар