webdeveloper
Registered
Това е файла с линка за изтриване:
А това delete.php:
:?:
PHP:
<font size="3">Вие сте качили:</font><font color="#00bff6" size="4"><? include("modules/totalupload/index.php"); ?> </font>Песни</a>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="10%" class="border2" align="center"><b style="font-size: 11px;">Заглавие</b></td>
<td width="2%" class="border2" align="center"><b style="font-size: 11px;">Изтри</b></td>
</tr>
<?php
include("settings.php");
$id = $_SESSION['username'];
$query = mysql_query("SELECT * FROM songs WHERE author='$id' order by views DESC LIMIT 100");
while ($row = mysql_fetch_array($query))
{
echo ' <tr>
<td class="border2"><a href="index.php?m=play&id='.$row['id'].'">'.$row['name'].'</a></td>
<td class="border2" align="center"><a href="myups.php?m=deletsong&ext=delete&id='.$row[id].'"><font color="red" size="2"> [x]</font></a></td>
</a></tr>';
}
?>
А това delete.php:
PHP:
<?
include"settings.php";
$user = $_SESSION['username'];
$sql = mysql_query("SELECT * FROM users WHERE username='$user'");
if (!isset($user))
{
die('Не сте логнат! <br /><a href="index.php">Върни се в началото</a>');
}
else {
$id = $_GET['id'];
if (isset($id) AND is_numeric($id)) {
$potrebitelq = $_SESSION['username'];
$sql = mysql_query("DELETE FROM `songs` WHERE `id`='$id' AND `author`='$potrebitelq'");
echo "<meta http-equiv='refresh' content='2; url=myups.php'>Песента е изтрита.";
}
else {
echo "Избери песен за триене.";
}
}
?>
:?: