HTTP_REFERER in PHP

Posted: June 23rd, 2009 | Author: | Filed under: (X)HTML, JS, PHP | Tags: , , , | Comments Off on HTTP_REFERER in PHP

linkingThis morning I added some new features to a webapplication we are developing. They worked fine in Firefox, so I opened Internet Explorer to see if everything worked in there too. Of course it didn’t…

In webapplications you may need to know which webpage requested the current one. PHP offers an easy way to find the URL of that page: the predefined server variable $_SERVER[‘HTTP_REFERER’]. Unfortunately this variable was not set in IE. So where did it go?

Read the rest of this entry »


iFrames, IE and session cookies

Posted: November 6th, 2008 | Author: | Filed under: PHP | Tags: , , , | Comments Off on iFrames, IE and session cookies

Session is lost when browsing in an iFrame

A very large problem with a very small solution: For security reasons Internet Explorer prevents carrying over session variables from one page to another when browsing in an iFrame. To enable this we somehow need to tell IE that the page we’re looking at is trusted and safe. This can be done by adding either a meta tag or a header (in this example sent using PHP) to the framed page:

<meta http-equiv="P3P" content='CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'>
header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');

Solution source: Sitepoint.com