gish Posted February 25, 2008 Share Posted February 25, 2008 hi everyone, all i want this to do is change the value and go back to the page that it came from. I am stuck. I can run the script but if i direct it back to the using an include statement say include temp.php it creates a loop and every time I press another a href it changes the orientation value and I don't want that to happen. it should only change when I press the code below. does any have any ideas. thanks gish a href="orientationtransfere.php" name="Orientation" if($_SESSION['datatransfere'] ['Orientation'] == 0){ $_SESSION['datatransfere'] ['Orientation'] = 1; }else{ $_SESSION['datatransfere'] ['Orientation'] = 0; } $_SESSION['datatransfere'] ['Progresstable']= $_SESSION['datatransfere'] ['Progresstable']+1 include "temp.php"; Link to comment https://forums.phpfreaks.com/topic/92857-change-session-value/ Share on other sites More sharing options...
aschk Posted February 25, 2008 Share Posted February 25, 2008 DON't use an include, instead use a header redirect e.g. <?php header("Location: yourpage.php"); ?> Link to comment https://forums.phpfreaks.com/topic/92857-change-session-value/#findComment-475656 Share on other sites More sharing options...
gish Posted February 25, 2008 Author Share Posted February 25, 2008 I tried this an it comes up with an error Parse error: syntax error, unexpected T_STRING in /data/webpage/orientationtransfere.php on line 8 if($_SESSION['datatransfere'] ['Orientation'] == 0){ $_SESSION['datatransfere'] ['Orientation'] = 1 header("Location:temp.php"); }else{ $_SESSION['datatransfere'] ['Orientation'] = 0; header("Location:temp.php"); } $_SESSION['datatransfere'] ['Progresstable']= $_SESSION['datatransfere'] ['Progresstable']+1; Link to comment https://forums.phpfreaks.com/topic/92857-change-session-value/#findComment-475668 Share on other sites More sharing options...
gish Posted February 25, 2008 Author Share Posted February 25, 2008 I got it to work but it sets the orientation back to default every time. header("Location:http://192.168.1.2/purefun/temp/temptransfere.php"); # this is so that orientation will change equations orientation if($_SESSION['datatransfere'] ['Orientation'] == 0){ $_SESSION['datatransfere'] ['Orientation'] = 1; }else{ $_SESSION['datatransfere'] ['Orientation'] = 0; } $_SESSION['datatransfere'] ['Progresstable']= $_SESSION['datatransfere'] ['Progresstable']+1; exit; Link to comment https://forums.phpfreaks.com/topic/92857-change-session-value/#findComment-475673 Share on other sites More sharing options...
gish Posted February 25, 2008 Author Share Posted February 25, 2008 anyone got any ideas Link to comment https://forums.phpfreaks.com/topic/92857-change-session-value/#findComment-476292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.