Having a little bit of trouble with this section of code:
if(!empty($_POST['RemoveRequest']) && isset($_POST['RemoveRequest'])){ $action = $_POST['RemoveRequest']; }
echo '<form method="post" action="'.$page_name.'">
<input type="submit" value="[Remove Request]" name="RemoveRequest" /></form></td>'
.'</tr></table>';
if($action == 'RemoveRequest'){
$sql = "DELETE FROM ".TBL_FACTION_REQUESTS." WHERE r_id=$id LIMIT 1";
mysql_query($sql);
header("Location: ".$page_name."");
}
This form and server code is throwing this error:
Notice: Undefined variable: action in C:\xampp.. on line 97.
Then the record isn't deleted from my DB.
I'm really confused at what i'm doing wrong here? Tried a bit of debugging myself, but haven't had any luck yet. Hoping someone can help me out!