Session Vars not storing

A

Anonymous

Guest
The following script (process.php) is made to have a form POSTED to it and then if there are errors in the form, send it back to the form (form.php).

The problem occurring is that the form variables, which are stored in the sessions by process.php are not being accesible from on form.php. This same script works correctly on my test server (running Apache on windows xp home) but on the actual server that is running IIS it isn't working.

Code:
<?php
session_start();

include("d52er/includes/validator.class.php");
$fv = new FormValidator;
if (isset($_POST['Submit']) && @$fv->isEmail('Email', '') && @$fv->isEmpty('Name', '')) {
	//Prepare email from form
	unset($_POST['Submit']);
	$message = '';
	$postkeys = array_keys($_POST);
	foreach ($postkeys as $p) {
		$message.= ucfirst(str_replace('_', ' ', $p)).": ".$_POST[$p]."\n";
	}
} else {
	$postkeys = array_keys($_POST);
	foreach ($postkeys as $p) {
		$_SESSION['earrings_form'][$p] = $_POST[$p];
	}
	$get = '?error=true&mount='.$_POST['Mount_ID'].'&';
	if (@!$fv->isEmpty('Name', '')) {
		$get.= "name=false&";
	}
	if (@!$fv->isEmail('Email', '')) {
		$get.= "email=false&";
	}
	
	header("Location: form.php".$get);
}
?>
 
Can you also post the form script? I don't see any errors in this one...

Coditor
 
Code:
<?php
session_start();
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
@include_once("d52er/includes/functionlib.inc.php");
if (!isset($_GET['mount'])) {
	header("Location: earrings.php");
} else {
	$sql = "SELECT * FROM earrings WHERE id = ".$_GET['mount'];
	$result = mysql_query($sql);
	if (mysql_num_rows($result) > 0) {
		$row = mysql_fetch_assoc($result);
	} else {
		header("Location: earrings.php");
	}
}
?>

I don't think the problem is in this page, as the session vars are being output right at the top before anythign else is happening - and like I said it works fine on my testing server so I think what I'm looking for is a compatibility issue with my first code I posted - but that kind of thing is beyond me.
 
Back
Top