So I have a problem with a Session. I have 2 sessions set on separate pages, but both post to index.php. Both work perfectly well on my machine I setup with php & MySQL. However when uploading to my 1&1 webhost, only the ResultsToDisplay will stay in session while I am logged in. The StateFilter session will not work when I upload to my 1&1 webhost. I have tried everything I can think of, but only the ResultsToDisplay will work on my webhost server, the StateFilter will always be blank. Here is my code for each session:
page1.php
index.php
page1.php
Code:
<form method="post" action="index.php">
<select name="ResultsToDisplay">
<option value="5">5</option>
</select>
index.php
Code:
<?php session_start(); ?>
$StateFilter=$_POST['StateFilter'];
$ResultsToDisplay=$_POST['ResultsToDisplay'];
if(isset($ResultsToDisplay)){
$_SESSION['ResultsToDisplay']=$ResultsToDisplay;
}
if(isset($StateFilter)){
$_SESSION['StateFilter']=$StateFilter;
}
<form method="post" action="./index.php" style="margin-bottom:0; margin-top: 0; display: inline;">
<select name="StateFilter" style="width: 100px; font size: 11px;" onchange=submit()>
<option value="All" <?php if(!isset($_SESSION['StateFilter'])){echo "SELECTED";}?>>All</font></option>
</select>