Iframe doesn't work in second domain in Firefox



  • I have two domains, one the forum works in any browser, The second domain doesn't work in Firefox.
    I'm using iframe to display the forum.
    First method http://forum.imjetset.com/

    <?php
    function url_origin( $s, $use_forwarded_host = false )
    {
        $ssl      = ( ! empty( $s['HTTPS'] ) && $s['HTTPS'] == 'on' );
        $sp       = strtolower( $s['SERVER_PROTOCOL'] );
        $protocol = substr( $sp, 0, strpos( $sp, '/' ) ) . ( ( $ssl ) ? 's' : '' );
        $port     = $s['SERVER_PORT'];
        $port     = ( ( ! $ssl && $port=='80' ) || ( $ssl && $port=='443' ) ) ? '' : ':'.$port;
        $host     = ( $use_forwarded_host && isset( $s['HTTP_X_FORWARDED_HOST'] ) ) ? $s['HTTP_X_FORWARDED_HOST'] : ( isset( $s['HTTP_HOST'] ) ? $s['HTTP_HOST'] : null );
        $host     = isset( $host ) ? $host : $s['SERVER_NAME'] . $port;
        return $protocol . '://' . $host;
    }
    
    function full_url( $s, $use_forwarded_host = false )
    {
        return url_origin( $s, $use_forwarded_host ) . $s['REQUEST_URI'];
    }
    
    $absolute_url = full_url( $_SERVER );
    $url = str_replace("forum.imjetset.com", "forum.superaffiliatesystem.com", $absolute_url);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <title>Jetset Forum | Affiliate Marketing Forum</title>
            <meta http-equiv="X-Frame-Options" content="allow">
            <style type="text/css">
                body, html
                {
                    margin: 0; padding: 0; height: 100%; overflow: hidden;
                }
    
                #content
                {
                    position:absolute; left: 0; right: 0; bottom: 0; top: 0px; 
                }
            </style>
        </head>
        <body>
            <div id="content">
                <iframe width="100%" height="100%" frameborder="0" src="<?php echo $url; ?>" />
                <div id="result"></div>
            </div>
        </body>
    </html>
    

    Second method http://forum.imjetset.com/index1.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <title>Jetset Forum | Affiliate Marketing Forum</title>
            <meta http-equiv="X-Frame-Options" content="allow">
            <style type="text/css">
                body, html
                {
                    margin: 0; padding: 0; height: 100%; overflow: hidden;
                }
    
                #content
                {
                    position:absolute; left: 0; right: 0; bottom: 0; top: 0px; 
                }
            </style>
        </head>
        <body>
            <div id="content">
                <iframe width="100%" height="100%" frameborder="0" src="http://forum.superaffiliatesystem.com" />
                <div id="result"></div>
            </div>
        </body>
    </html>
    

    Third method - http://forum.imjetset.com/index2.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <title>Jetset Forum | Affiliate Marketing Forum</title>
            <meta http-equiv="X-Frame-Options" content="allow">
            <style type="text/css">
                body, html
                {
                    margin: 0; padding: 0; height: 100%; overflow: hidden;
                }
    
                #content
                {
                    position:absolute; left: 0; right: 0; bottom: 0; top: 0px; 
                }
            </style>
        </head>
        <body>
            <div id="content">
                <iframe width="100%" height="100%" frameborder="0" src="http://52.41.178.169" />
                <div id="result"></div>
            </div>
        </body>
    </html>
    

    Neither method works, does anyone have any idea how I could do to fix this? Google Chrome works correctly


  • Global Moderator

    @Braulio-Cesar-Holtz-Ribeiro you need to set the HTTP header for frame options on the site that is displayed inside the iframe.

    NodeBB actually has a setting for this in the ACP. You should be able to find it by searching "frame"


 

| |