Hi,
I can't seem to figure out why the header function is not working in this conditional loop. Everything inside of it is executing just fine except for that stupid little header().
Here is my code, I start it off with the call to the function.
<?PHP
/*
This is how I'm calling the function.
*/
echo "<a href=\"adminPanel.php?do=menus&action=mUP&mID={$menu['menu_name']}&mPOS={$menu['menu_position']}&mODR={$menu['menu_order']}\"><img src=\"images/up.gif\" border=\"0\"></a> "
."<a href=\"adminPanel.php?do=menus&action=mDN&mID={$menu['menu_name']}&mPOS={$menu['menu_position']}&mODR={$menu['menu_order']}\"><img src=\"images/down.gif\" border=\"0\"></a> ";
/*
Function I'm using to order elements. I don't think it's super important but I wanted to include it incase someone spots a screwup.
*/
function modify_menus() {
global $tblBGColor1, $tblBGColor2, $tblBGColor3;
$action = $_GET['action'];
db_conn();
$getMenus = mySQL_QUERY ("SELECT * FROM menus ORDER BY menu_position ASC");
$numMenus = mySQL_NUM_ROWS($getMenus);
display_menus($ttl='yes', $mPosition='left');
display_menus($ttl='no', $mPosition='right');
if ($action == 'mUP') {
$menu_name = $_GET['mID'];
$menu_position = $_GET['mPOS'];
$menu_order = $_GET['mODR'];
$getREPLACEMENT = mySQL_QUERY ("SELECT menu_name, menu_position, menu_order
FROM menus
WHERE menu_order = ($menu_order - 1)
AND menu_position LIKE '$menu_position'");;
while ($replacement = mySQL_FETCH_ARRAY ($getREPLACEMENT)) {
$repName = $replacement['menu_name'];
$repPosition = $replacement['menu_position'];
$repOrder = $replacement['menu_order'];
}
mySQL_QUERY ("UPDATE menus
SET menu_order = '$repOrder'
WHERE menu_name = '$menu_name'");
mySQL_QUERY ("UPDATE menus
SET menu_order = '$menu_order'
WHERE menu_name = '$repName'");
header ("Location: adminPanel.php?do=menus");
}
if ($action == 'mDN') {
$menu_name = $_GET['mID'];
$menu_position = $_GET['mPOS'];
$menu_order = $_GET['mODR'];
$getREPLACEMENT = mySQL_QUERY ("SELECT menu_name, menu_position, menu_order
FROM menus
WHERE menu_order = ($menu_order + 1)
AND menu_position LIKE '$menu_position'");;
while ($replacement = mySQL_FETCH_ARRAY ($getREPLACEMENT)) {
$repName = $replacement['menu_name'];
$repPosition = $replacement['menu_position'];
$repOrder = $replacement['menu_order'];
}
mySQL_QUERY ("UPDATE menus
SET menu_order = '$repOrder'
WHERE menu_name = '$menu_name'");
mySQL_QUERY ("UPDATE menus
SET menu_order = '$menu_order'
WHERE menu_name = '$repName'");
}
}
?>
Any suggestions would be great. Thx.