Asheh Posted March 29, 2007 Share Posted March 29, 2007 I have a site below: http://www.nngb-evaluation.co.uk/acrylic_new/ When you click an image, it uses GET to submit to the iframe above. then it switches each session variable to the selected one, and so on. Unfortunately im not getting the desired effects AT ALL, you select the first one, it messes up the second one and so on! Whats the deal with sessions? Ash. Link to comment https://forums.phpfreaks.com/topic/44771-sessions-not-working/ Share on other sites More sharing options...
Asheh Posted March 29, 2007 Author Share Posted March 29, 2007 For example, You can click somthing and you would have to click it twice for it to appear. Then clicking on somthing else would take that image back to the previous! Link to comment https://forums.phpfreaks.com/topic/44771-sessions-not-working/#findComment-217373 Share on other sites More sharing options...
Asheh Posted March 29, 2007 Author Share Posted March 29, 2007 As below! This is similar to my problem, does anyone know the fix? what is the problem with the below code??? Please! Ash. The session variable is still lost when navigating even if I change $setting or $_SESSION['setting']. If you assign a session subscript/key to the same name as a variable, the session variable will be volatile and lost upon navigating. For example, if passing a setting that you want in $_SESSION, don't do this: <? $setting = $_REQUEST['setting']; if (!empty($setting)) $_SESSION['setting'] = $setting; ?> Instead, rename $setting or $_SESSION['setting']. Link to comment https://forums.phpfreaks.com/topic/44771-sessions-not-working/#findComment-217377 Share on other sites More sharing options...
komquat Posted March 29, 2007 Share Posted March 29, 2007 How about some of your code you are using. There are many around here that are experts at Sessions, but they will need some code to help you out. Link to comment https://forums.phpfreaks.com/topic/44771-sessions-not-working/#findComment-217386 Share on other sites More sharing options...
Asheh Posted March 29, 2007 Author Share Posted March 29, 2007 Well its separated into 4 different files. Here is what each IFRAME does with some differences <a href="#" onClick="postToIframe('<?=$_SESSION['plate']?>','<?=$_SESSION['custom_text']?>', '<?=$_SESSION['base']?>', '<?=$file_list[$i]?>', '<?=$_SESSION['border']?>','<?=$_SESSION['bordercolour']?>','<?=$_SESSION['ghost']?>');"> <img src="image_library/badges/thumbs/<?=$thumb_loc?>" border="0" alt="<?=$file_list[$i]?>"> </a> The iframe which displays the final image does this: //Set to defaults if(!isset($_SESSION['badge']) OR strlen($_SESSION['badge'])==0) { $_SESSION['badge'] = "none"; } //change of setting requested if($_GET['badge'] OR $_POST['badge']) { if(isset($_GET['badge'])) { $_SESSION['badge'] = $_GET['badge']; } else { $_SESSION['badge'] = $_POST['badge']; } } Having many problems though! anyone? Link to comment https://forums.phpfreaks.com/topic/44771-sessions-not-working/#findComment-217390 Share on other sites More sharing options...
jitesh Posted March 29, 2007 Share Posted March 29, 2007 You can do it without using of session From one frame you can target another frame <iframe name="a" src="displayimage.php?imageid=1"> <iframe name="b" src="listofimages.php"> in file listofimages.php suppose you have a link <a href="displayimage.php?imageid=<?php echo $imageid?>" target="a"> Link to comment https://forums.phpfreaks.com/topic/44771-sessions-not-working/#findComment-217401 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.