I need to let my users to access to remote Admin Dashboard software trough an Iframe. Software developers provided to me a Curl code to include in my page and this code work well...except the fact I get issue when using some specific browser.
In practice I can access to dashboard without problem with any browser but when I want access to some specific remote page (by clicking on related link present in the dashboard itself) I get a message coming from the remote server who say I must login for see those pages. This is very strange because I'm already logged-in otherwise is not possible to see Dashboard.
The problem happen when using IE and Safari but not when using Chrome or Firefox... My site and remote server do no use SSL... Is now many days we investigate for troubleshoot but without success. I tested using different PC under Window and Ubuntu from different location... That crazy.. :-(
Below the code used... Someone have an idea why I get problem only with some specific browser ??
<?php
$api_key = '123-my-api-key-456';
$admin_email = 'my@email.com';
?>
<?php
$response_raw = null;
$api_url = "http://www.remote-server.com/rest/?api_key=$api_key&method=get_login_credentials&email=$admin_email";
if (function_exists('curl_init')) {
$cs = @curl_init($api_url);
if ($cs) {
@curl_setopt ($cs, CURLOPT_RETURNTRANSFER, 1);
$response_raw = @curl_exec ($cs);
@curl_close ($cs);
}
}
if (!$response_raw)
$response_raw = file_get_contents($api_url);
$response_json = json_decode($response_raw, true);
$login_hash = $response_json['data']['login_hash'];
$user_id = $response_json['data']['user_id'];
if ($_REQUEST['mbm_gotourl'])
$iframe_url = $_REQUEST['mbm_gotourl'] . (strpos($_REQUEST['mbm_gotourl'], '?') === false ? "?" : "&") . "login_hash=".$login_hash."&user_id=".$user_id."&mbm_iframe=1";
else
$iframe_url = "http://www.remote-server.com/admin.php?custom-language=FR&login_hash=".$login_hash."&user_id=".$user_id."&mbm_iframe=1";
if ($login_hash && $user_id) {
?>
<iframe id='mbm_be_frame' src='<?php echo $iframe_url;?>' width='944' scrolling='no' frameborder='0' ></iframe>
<script type='text/javascript' src='http://www.remote-server.com/mbm-be.js'></script>
<?php
}
?>