I have at the top of my Page1.php the following.
<?php
session_start();
$_SESSION['ALL_YEAR'] = $_POST['ALL_YEAR'];
?>
I am trying to capture the form selection for a select called ALL_YEAR when this button is pushed:
<button type="button" value="Send" id="avgSubmitXLEW_1_12_3" onClick="location.href=this.value">Configure</button>
on Page2.php I have this at the top:
<?php
session_start();
$home = $_REQUEST['ALL_YEAR'];
?>
Farther down in the body of the page I have this:
<? echo $_session['home'];?>
The value is not showing up in the echo? What am I doing wrong?
instead of :
$home = $_REQUEST['ALL_YEAR'];
...
<? echo $_session['home']; ?>
you should do :
$home = $_SESSION['ALL_YEAR'];
...
<?php echo $home; ?>
PHP variable names are case sensitive:
<? echo $_session['home'];?>
should be
<? echo $_SESSION['home'];?>