PHP application help
Posted: Mon Nov 17, 2008 10:32 am
Hey,
Currently my site can be viewed on an external site's application with my site in an iframe.
Now what i have is this on the file on my server which is what the external site loads for the application:
This is working perfectly but when $_SESSION['Var'] is set, a different CSS file is loaded so that the site loads and fits in the iframe perfectly.
Now if a user leaves the site with the iframe and visits the main site normally, the $_SESSION['Var'] is still set and thus it loads the wrong layout. Is there a way I can check when the following situation occurs:
if user views http://www.domain.com via iframe on secondary site
if user views http://www.domain.com normally on browser
That way i can unset $_SESSION['Var'] if its the latter so the layout is back to normal.
Perhaps theres a way in php to check if the site is in an iframe ?
Any thoughts that may help is much appreciated.
Currently my site can be viewed on an external site's application with my site in an iframe.
Now what i have is this on the file on my server which is what the external site loads for the application:
Code: Select all
<?php
require_once 'library/client/library.php';
session_start();
$_SESSION['Var'] = 1;
?>
<iframe src ="http://www.domain.com" width="630" height="600" style="overflow-x: hidden;">
</iframe>
?>
Now if a user leaves the site with the iframe and visits the main site normally, the $_SESSION['Var'] is still set and thus it loads the wrong layout. Is there a way I can check when the following situation occurs:
if user views http://www.domain.com via iframe on secondary site
if user views http://www.domain.com normally on browser
That way i can unset $_SESSION['Var'] if its the latter so the layout is back to normal.
Perhaps theres a way in php to check if the site is in an iframe ?
Any thoughts that may help is much appreciated.