Jump to content

results from an array saved in $SESSION?


vassili

Recommended Posts

in show.php i have this...

 

$cartSizes = isset($_SESSION['cartSizes']) ? $_SESSION['cartSizes'] : array();
$maxSizes = 8;
$productid = $_GET['id'];

$cartSizes[$productid] = array();

for( $i=1;$i<$maxSizes; $i++ ){

$cartSizes[$productid][$i] += $_POST['qty'.$i]; 
}

$_SESSION['cartSizes'] = $cartSizes;

 

so now array $cartSizes should be saved in session.  now i want to place the value of $cartSizes[$productid][$i] into an input text field in another file called function.php.  we'll say $i=1 so i want the value in $cartSizes[$productid][1]

 

i need to place the value in this line of function.php

 

$output[] = '<input type="hidden" name="qty'.$id.'" value="[b]I HAVE NO IDEA[/b]" size="3" maxlength="3" />';

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/90960-results-from-an-array-saved-in-session/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.