Boa noite estou criando um sitema de cadastro , pois bem eu estou conseguindo incluir normalmente, só que quando vou excluir me dá a amensagem de variavel indefinida e até agora não consegui achar o erro...Por favor me ajudem.
segue o codigo abaixo para voces darem uma olhada:
abaixo o arquivo listar.php
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>USUARIOS CADASTRADOS</title>
<link href="estilo.css" rel="stylesheet" type="text/css">
</head>
<body>
<a href="cadastro.html" title="Voltar para cadastrar" target="_parent">CADASTRAR</a>
<div id="visualiza">
<?php
include ("conectar.php");
$result = mysql_query('SELECT * FROM dados');
echo "<table border='1' bgcolor='#069' width='548px';>
<tr>
<th></th>
<th>CÓDIGO</th>
<th>NOME</th>
<th>IDADE</th>
<th>INFORMAÇÕES</th>
</tr>";
while($row = mysql_fetch_array($result)) {
echo "<tr>";
echo'<td><a href=\'editar.php?id=$id\'>[Editar]</a>
<a href=\'excluir.php?id=$id\'>[Excluir]</a></td>';
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['nome'] . "</td>";
echo "<td>" . $row['idade'] . "</td>";
echo "<td>" . $row['digitar'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
</div>
</body>
</html>
e agora o arquivo escluir.php
<?php
include ("conectar.php");
$id = $_POST["id"];
$sql =" DELETE FROM dados WHERE id = '$id'";
$query=mysql_query($sql) or exit("Houve um erro na EXCLUSÃO dos dados, verifique os valores passados");
/*header("location:listar.php");*/
?>
LEMBRANDO QUE O INTERPRETADOR APONTA O ERRO LA LINHA 5 DO ARQUIVO excluir.php que é essa "$id = $_POST["id"];" .
POREM JÁ FIZ DE TUDO , ATÉ TROQUEI PELO MÉTODO GET coloquei aspas simples... O QUE EU FAÇO ?
ABRAÇOS.