Jump to content

framesets variables and sessions???


SycoSyco

Recommended Posts

I'm working on a very large system that I only have partial access too. The bods with full access are out if the office today and I'm having a few problems.

 

I need to take a URL from an email that contains vars in the URL string and go to a login page. The user must log in then get taken to a page where the vars are used.

 

I don't have access to the parent frameset page, only the page within the frame set. I figured I could go to the login page (the URL of the page within the frameset) eg

 

www.site.com/login.php?test=1

 

and write to the session like this

 

Here's an example if 'test' was in the URL

if(isset($_GET['test'])){
$_SESSION['emailed']['test1']=$_GET['test'];
}
<?
}
$_SESSION['emailed']['test2']="test";

 

then bounce the frameset before any output using

<script>
if (parent.location.href == self.location.href){
    window.location.href = '/'
}
</script>

 

test2 is available after the page is bounced to the parent frameset but test1 is gone.

 

If I don't bounce the page both test vars are available.

 

Any idea where I might be going wrong?

Link to comment
https://forums.phpfreaks.com/topic/55314-framesets-variables-and-sessions/
Share on other sites

well first of all you might wanna change

this:

if(isset($_GET['test'])){
$_SESSION['emailed']['test1']=$_GET['test'];
}
<?
}
$_SESSION['emailed']['test2']="test";

to:

<?
if(isset($_GET['test'])){
$_SESSION['emailed']['test1']=$_GET['test'];
}
$_SESSION['emailed']['test2']="test";

and im not sure exactly what you want to do

well im a noob

thats why

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.