Having trouble with header redirection passing variables from the url.
<? ob_start(); ?>
<?php
require_once ("Includes/config.php");
require_once ("Includes/connectDB.php");
include("Includes/header.php");
confirm_is_admin();
$lid = $_GET['lid'];
$yr = $_GET['yr'];
$gid = $_GET['gid'];
$pid = $_GET['pid'];
$pn = $_GET['pn'];
if (is_admin())
{
$aid = $_GET['aid'];
$query = "DELETE FROM articles WHERE article_id = ?";
$statement = $databaseConnection->prepare($query);
$statement->bind_param('i', $aid);
$statement->execute();
$statement->store_result();
if ($statement->error)
{
die('Database query failed: ' . $statement->error);
}
// TODO: Check for == 1 instead of > 0 when State names become unique.
$deletionWasSuccessful = $statement->affected_rows > 0 ? true : false;
if ($deletionWasSuccessful)
{
header("Location:articlelist.php?lid=$league_id&yr=$season&gid=$gid&pid=$pid&pn=$pn");
}
else
{
echo "Failed deleting Article";
}
}
else
{
header("Location:articlelist.php?lid=$lid&yr=$yr&gid=$gid&pid=$pid&pn=$pn");
}
?>
<?php include ("Includes/footer.php");?>
<? ob_flush(); ?>