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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.