i've form which is like:
<form action="del.php" method="post" enctype="multipart/form-data">
Number of field to show:<input type="text" name="limit" /><br /><br /> 
Top category: 
<select name="topcat"> 
<option>tech</option>
<option>automobile</option>
</select><br /><br />
Base category: 
<select name="cat"> 
<option>mobile</option>
<option>computer</option>
</select> 
<input type="submit" />
</form>
i'm trying to write code to delete particular id from database selected from page: del.php :
<head>
<?php
require_once('globals.php');// for database connection
?>
</head>
<body>
<?php
        $cat = $_POST['cat'];
    $topcat = $_POST['topcat'];
    $limit = $_POST['limit'];
if(isset($_GET['delete']))
{
    $query = 'DELETE FROM '.$cat.' WHERE id = '.(int)$_GET['delete'];
    echo $query;
    $result = mysql_query($query);
}
$query = 'select id,headline from '. $cat.' order by date DESC limit 0,'.$limit;
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
$headline=$row['headline'];
    echo '<div class="record" id="record-'.$row['id'].'">
                <a href="?delete='.$row['id'].'" class="delete">Delete</a>
                <strong>'.$headline.'</strong>
            </div>';
}
?>
</body>
Problem: when isset($_GET['delete'] get executed, it says undefined variable cat .
but $cat is defined as parsed from previous form.
any solution?
 
     
     
    