I have the following declaration at the beginning of my PHP script:
$GLOBALS['monthselect'] = date('m');
$GLOBALS['yearselect'] = date('Y');
during the script I assign the following values:
$GLOBALS['monthselect'] = $_GET['mo'];
$GLOBALS['yearselect'] = $_GET['yr'];
Next, after a form submits, I want to redirect it to the same selection in GET. (This is all in the same PHP script)
header('Location: ?yr='. $GLOBALS['yearselect'] .'&mo=' . $GLOBALS['monthselect']);
Problem is, this always reloads the page with the date of today. Never the newly stored values. So always this output:
website.com/?yr=2013&mo=06
What am I missing here?