[FX.php List] Trying to read back an array

Bob Patin bob at patin.com
Fri Sep 17 07:18:37 MDT 2010


Hi guys,

In my last episode our hero was trying to store input into arrays; he got that far...

Now he's trying to get this back, and here's the problem:

I store the POST values here:

// loop through the recid array and create the product arrays
if( (strlen($_POST['recid'])>0) && (is_array($_POST['recid']))) {
	foreach($_POST['recid'] as $recid) {
		$_SESSION['description['.$recid.']'] = $_POST['description'.$recid] ;
		$_SESSION['type['.$recid.']'] = $_POST['type'.$recid] ;
		$_SESSION['serial['.$recid.']'] = $_POST['serial'.$recid] ;
		$_SESSION['problem['.$recid.']'] = $_POST['problem'.$recid] ;
		$_SESSION['recid['.$recid.']'] = $recid ;
	}
}

I can return $recid with no trouble, so I'm fairly certain that all my session vars are getting populated.

NOW... I want to show these on the same page, and wrote this:

	  <?php
	  // loop through the recid array and create requests for each item
		foreach($_SESSION['recid'] as $recid) {
			$status = "Open; pending manufacturer approval";
			$description = $_SESSION['description'.$recid];
			$problem = $_SESSION['problem'.$recid];
			$serial = $_SESSION['serial'.$recid];
			echo $recid;
	?>
<<<< TABLE >>>>
<?php
}
?>

What am I missing here? My FOREACH doesn't return anything at all, and doesn't loop a single time.

Thanks,


Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
iChat: bobpatin
FileMaker 9, 10 & 11 Certified Developer
Member of FileMaker Business Alliance and FileMaker TechNet
--
Expert FileMaker Consulting 
FileMaker Hosting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20100917/303d3061/attachment.html


More information about the FX.php_List mailing list