-1

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?

4

1 回答 1

1

您能否提供您设置的位置$GLOBALS['monthselect'] = $_GET['mo'];$GLOBALS['yearselect'] = $_GET['yr'];确保它们被执行..

于 2013-06-23T15:34:39.443 回答