Salve a tutti!
Ho un piccolo problema...non macino bene per niente bene il php però fino ad ora me la ero "cavata" benino....
Ho questo codice:
Codice PHP:
<html>
<head>
<title>Mofica - Reclutamento 3.0 By Caligola</title></head>
<body>
<form method='get' action="<?php echo $_SERVER['PHP_SELF']?>">
<?php
require("config.php");
if ($_COOKIE["login"] == "OK")
{
?>
<h6>Torna alla [url="home.php"]Home Page[/url]</h6>
I dati presenti nel database sono i seguenti:
<table border=1>
<tbody>
<tr>
<th>Reclutato:</th>
<th>Reclutante:</th>
<th>Data:</th>
<th>Eventuale Risposta:</th>
<th>M:</th>
<th>C:</th>
</tr>
<?php
$result = mysql_query("SELECT * FROM reclutamento") or die(mysql_error());
while($row = mysql_fetch_array($result))
{
?><tr>
<th><?php echo "".$row['reclutato']."" ?></th>
<th><?php echo "".$row['reclutante']."" ?></th>
<th><?php echo "".$row['data']."" ?></th>
<th><?php echo "".$row['risposta']."" ?></th>
<th><input type="image" src="lap.png" name="modi" value="<?php echo "".$row['id']."" ?>"></th>
<th><input type="image" src="can.png" name="canc" value="<?php echo "".$row['id']."" ?>" onclick='GET'></th>
</tr>
<?php
}
if(isset($_GET['id']))
{
$id = $_GET['canc'];
echo "$id";
// Creo la query
mysql_query("DELETE FROM reclutamento WHERE id = '$id';")
or die(mysql_error());
echo "Dati cancellati!
Torna alla ";?>[url="home.php"]Home Page[/url]<?php
}
?>
</tbody>
</table>
</body>
</html>
<?php
}
else
{
?>
<center>
Accesso negato!</p>
Effettua il[url="index.php"]Login[/url]</p>
</center>
<?php
}
?>
La stringa interessata è questa:
Codice PHP:
<input type="image" src="can.png" name="canc" value="<?php echo "".$row['id']."" ?>" onclick='GET'>
Ne ho provate di tutte però con nessun risultato, praticamente quando permi sull'immagine canc.png mi dovrebbe eseguire la querry mysql_query("DELETE FROM reclutamento WHERE id = '$id';") il problema è uno...quando premo sull'immagine non succede un bel niente
ho sbagliato sicuramente metodo di invio...perché non mi da nessun errore sql (ho provato ad eseguire la query in phpmyamdin e va bene) non mi scrive (usato per debug) l'id che va a cancellare "$_GET['canc']; echo "$id";" ...
Mi date una mano??