phpretard Posted April 19, 2008 Share Posted April 19, 2008 I can see where the problem lies but cant find the answer. Can anyone tell me why I can't see the pictures? echo '<pre>$_SESSION:' . print_r($_SESSION,true) . '</pre>'; The Above Yeilds This In The Browser: $_SESSION:Array ( [P1040050.jpg] => Array ( [picture] => ALBUMS/Holmes_Adams/P1040050.jpg //<----PICTURE 1 LOCATION [file] => P1040050.jpg [s46] => 4 x 6 [QU46] => 10 [s57] => 5 x 7 [QU57] => 20 [s810] => 8 x 10 [QU810] => 30 [order_photo] => Order This Photo ) [P1040052.jpg] => Array ( [picture] => ALBUMS/Holmes_Adams/P1040052.jpg //<------PICTURE 2 LOCATION [file] => P1040052.jpg [s46] => 4 x 6 [QU46] => 30 [s57] => 5 x 7 [QU57] => 20 [s810] => 8 x 10 [QU810] => 10 [order_photo] => Order This Photo ) ) foreach ($_SESSION as $file => $val){ echo"<img src='" . $_SESSION['picture_id']['picture'] . "'>"; } I was expecting 2 pictures to show up based on the session variables...all I get is an unidentified picture. I have been reading about this and can't pick up the answer anywhere. Quote Link to comment Share on other sites More sharing options...
Fadion Posted April 19, 2008 Share Posted April 19, 2008 Where does picture_id get its value? Quote Link to comment Share on other sites More sharing options...
phpretard Posted April 19, 2008 Author Share Posted April 19, 2008 From a form. if(isset($_POST['order_photo'])){ $picture_id = $_POST['file']; foreach($_POST as $key => $val){ $_SESSION[$picture_id][$key] = $val; } } Quote Link to comment Share on other sites More sharing options...
Fadion Posted April 19, 2008 Share Posted April 19, 2008 It looks ok then. U got the right array keys and values. The upper & lower case filenames do match those of the real folders? Are u sure the relative filepaths of the images set in the arrays are correct? Quote Link to comment Share on other sites More sharing options...
phpretard Posted April 19, 2008 Author Share Posted April 19, 2008 Absolutely 100% I really need to know how to echo/print ---"ALBUMS/Holmes_Adams/P1040050.jpg"--- (within a foreach loop) from the two arrays. http://www.rememberthetimephotos.com/ALBUMS/Holmes_Adams/P1040050.jpg <-- picture path Don't mind the picture...It's kind of scary:) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.