I'm using the module to pull an iFrame into a node to integrate an external non-Drupal billing portal (http://web61244.controlmywebsite.com/online-billing)

When viewing the iFrame in IE7 and then trying to log in we're getting an HTTP 500 error. Refreshing the frame then brings the login screen back but it can't seem to get past that point.

If we bring up the url for the iFrame direct in IE, then we're able to log in without problems, so the page for the portal works fine.

Everything works fine for FF, it's just when using IE and the iFrame.

Any suggestions?

Comments

MarcElbichon’s picture

IE7 use a policy. For more help, http://www.p3pxml.com/ or search "P3P privacy policy"

Create a file p3p.xml

<?xml version="1.0" encoding="UTF-8" ?>
<META xmlns="http://www.w3.org/2000/12/P3Pv1">
<POLICY-REFERENCES>
   <POLICY-REF about="/w3c/policy.xml">
     <INCLUDE>/*</INCLUDE>
     <COOKIE-INCLUDE>* * *</COOKIE-INCLUDE>      
   </POLICY-REF>
</POLICY-REFERENCES>
</META>
 

and include in your files

header("P3P: policyref=\"http://yoururl/p3p.xml\",CP=\"NON DSP COR CURa PSA PSD OUR BUS NAV STA\"");
Dubber Dan’s picture

Ok thanks, that looks good. Have created the p3p.xml file and uploaded to the server. Do I add the PHP code into page.tpl.php and if so where, in the < /head > ?

MarcElbichon’s picture

I don't know.
I think you can add it in the first line of page.tpl.php.
According to posts, this must be added before any write to page.

MarcElbichon’s picture

Assigned: Unassigned » MarcElbichon
Status: Active » Fixed

Php code must be inserted in pages shown in IFRAME, not in the "parent" site.

Fix this issue.

Dubber Dan’s picture

So are you saying I need to add that PHP code into the particular node where the iframe is called?

I've tried that and had to change the input format to PHP to get it to recognise the PHP, but then the code that calls the iframe doesn't work as it's not PHP
[[[http://www.myiframeurl.com height=600px scrolling=yes]]]

MarcElbichon’s picture

No. You had to add this code in the page called by the iframe (so the remote page).

Dubber Dan’s picture

Ah, I had a feeling you were going to say that! I don't know if we'll be able to get access to that page to be able to add the code, which will kinda stump us :-(

Thanks for the help.

MarcElbichon’s picture

Status: Fixed » Closed (fixed)
kirkhoward’s picture

Marc - Is there any way around gaining access to the REMOTE provider? I have this issue, and the content of my iFrame is out of my control, but my specification is to include their content in an iframe on my site. I have found that if I browse the remote site first, the iFrame works. Do you think there is a way to set the cookie first, before the iFrame loads?

MarcElbichon’s picture

If you want to add cookie by javascript, you can use theme functions :

  1. insertFrame_init : thrown in init page. You can add javascript to add cookie ou add reference to a new javascript file
  2. insertFrame_custom : Add call to a new function

Example 1 - add cookie at init

Code to add in your template.php

function mytemplate_insertFrame_init() {
  drupal_add_js(drupal_get_path('module', 'insertFrame') . '/myOwnInsertFrame.js');
}

Example 2 - add cookie on loading

Code to add in your template.php

function mytemplate_insertFrame_init() {
  drupal_add_js(drupal_get_path('module', 'insertFrame') . '/myOwnInsertFrame.js');
}

function mytemplate_insertFrame_custom($onload, $iframe_params) {
   if ($onload == "") {$onload = "onload='myOnLoadFunction()'";}
   else {$onload = str_replace("onload='","onload='myOwnLoadFunction();",$onload);}
   return $onload;
}

your javascript in myOwnInserFrame.js can be :

function myOnLoadFunction() {
    ...create my cookie here ...
}
//Only for example 1
myOnloadFunction();

Does this help you ?