PHP:
<?php require_once('header.php'); ?>
<?php
$news = @mysql_query("SELECT * FROM articoli ORDER BY id DESC") or die ("Errore Query");
?>
<!-- Content -->
<div id="content">
<div id="conteiner">
<div align="center">
<h2>Cancella News</h2>
<table width="90%" class="contacts" style="border-collapse: collapse" border="1">
<tr>
<td align="center" style="font-weight: bold" class="contactDept" width="50%">Titolo</td>
<td align="center" style="font-weight: bold" class="contactDept" width="20%">Data</td>
<td align="center" style="font-weight: bold" class="contactDept" width="20%">Autore</td>
<td align="center" style="font-weight: bold" class="contactDept" width="10%">Cancella</td>
</tr>
<?php
while ($row3 = @mysql_fetch_row($news))
{
echo '<tr> <td align="center" class="contact" width="50%">'.$row3[1].'</td>
<td align="center" class="contact" width="20%">'.$row3[3].'</td>
<td align="center" class="contact" width="20%">'.$row3[4].'</td>
<td align="center" class="contact" width="10%"><form action="PHP_SELF" Method="POST"> <input type="submit" name="cancella" value="Cancella">';
if(isset($_POST['cancella'])){
$query = "DELETE FROM articoli WHERE id='$row3[0]'";
}
echo '</form>';
}
?>
</table>
</div>
</div>
<?php require_once 'sidebar.php' ?></div><?php require_once 'footer.php' ?>
Quando provo ad cancellare un file spunta l'indirizzo "sito/PHP_SELF" come dovrei sistemarlo?