Jump to content

change session value


gish

Recommended Posts

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

 

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

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

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.