After doing a search for sessions on the forums, I'm still no clearer on resolving my issue.
I have a form on page1.php that posts to page2.php.
page2.php includes pagination by way of a class.
I set up debugging output for post, get, session, request, and the following:
if(isset($_SESSION['temp'])) {
$_SESSION['temp'] = TRUE;
$_SESSION['PropertyType'] = $_POST['PropertyType'];
$PropertyType = $_SESSION['PropertyType'];
} else {
$PropertyType = $_SESSION['PropertyType'];
}
print_r($_SESSION);
echo $PropertyType;
When I post to page2.php, I get these results:
POST: Array ( [PropertyType] => res [bedrooms] => No Minimum [bathrooms] => No Minimum [priceMin] => 0 [priceMax] => 200000 [acreageSize] => [schoolDistrict] => [zipcode] => [submit] => Search by Detailed Criteria )
GET: Array ( )
SESSION: Array ( [temp] => )
REQUEST: Array ( [PropertyType] => res [bedrooms] => No Minimum [bathrooms] => No Minimum [priceMin] => 0 [priceMax] => 200000 [acreageSize] => [schoolDistrict] => [zipcode] => [submit] => Search by Detailed Criteria [cprelogin] => no [cpsession] => TKv6jbJ1VVPGhpQVLFRHgzVXVhGyNTIa8EHqhOK4lGki9PF9fxQoPc6OJMzf0xxm [PHPSESSID] => 00dc158e5f4c9eb358a38f6da5ef8799 [webmailrelogin] => yes [webmailsession] => closed )
Array ( [temp] => 1 [PropertyType] => res ) res
When I click on any pagination within page2.php, I get this:
POST: Array ( )
GET: Array ( [page] => 2 )
SESSION: Array ( [temp] => )
REQUEST: Array ( [page] => 2 [cprelogin] => no [cpsession] => TKv6jbJ1VVPGhpQVLFRHgzVXVhGyNTIa8EHqhOK4lGki9PF9fxQoPc6OJMzf0xxm [PHPSESSID] => 00dc158e5f4c9eb358a38f6da5ef8799 [webmailrelogin] => yes [webmailsession] => closed )
Notice: Undefined index: PropertyType in /home/smachuga/public_html/listingsCriteria.php on line 57
Array ( [temp] => 1 [PropertyType] => )
Notice: Undefined index: PropertyType in /home/smachuga/public_html/listingsCriteria.php on line 87
Notice: Undefined index: bedrooms in /home/smachuga/public_html/listingsCriteria.php on line 99
Notice: Undefined index: bathrooms in /home/smachuga/public_html/listingsCriteria.php on line 111
Notice: Undefined index: priceMin in /home/smachuga/public_html/listingsCriteria.php on line 125
Notice: Undefined index: priceMax in /home/smachuga/public_html/listingsCriteria.php on line 143
Notice: Undefined index: zipcode in /home/smachuga/public_html/listingsCriteria.php on line 246
Where am I going wrong? I've tried all sorts of session tricks and nothing's worked yet.
Environment:
PHP 5.1.4
session.use_trans_sid = 0
session.name PHPSESSID
session.use_cookies On
session.use_only_cookies On