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"; Quote Link to comment 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"); ?> Quote Link to comment 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; Quote Link to comment 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; Quote Link to comment Share on other sites More sharing options...
gish Posted February 25, 2008 Author Share Posted February 25, 2008 anyone got any ideas 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.