Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 1, 2026.

Prevent part of script loading in iFrame

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
Watch

Bourkster

New Member
Impact
0
Here is a preview of my site: http://www.flamingbux.com

As you can see I have the menu bar and the iframe; however the menu bar is reloading in the iFrame preventing anything else from loading.

The menu bar is established in the configuration file such as
PHP:
    if($set['theme_active'])
    {
    DEFINE('THDIR', 'themes/'.$set['theme_active'].'/');
    DEFINE('HEADER', 'themes/'.$set['theme_active'].'/t.php');
    DEFINE('FOOTER', 'themes/'.$set['theme_active'].'/f.php');
    }
The main index file then loads as
PHP:
session_start();
include_once('configuration.php');

$ddir = THDIR.$do->get_file_url();
include($ddir);
if(file_exists(HEADER)) { include_once(HEADER); }
if($contents) { print $contents; }
if(file_exists(FOOTER)) { include_once(FOOTER); }
?>
The t.php (or theme header file) then loads as
PHP:
<?php
if(!defined("START_PROCESS")) { die(""); }
$title = $ref_title . " - ". $set['title'];
$kw = $set['keywords'];
$desc = $set['desc']; //desc
?>
<html>
<head>
<title><?php print $title ?></title>
<meta http-equiv="content-type" content="en-gb">
<meta http-equiv="keywords" content="<?php print $kw; ?>">
<meta http-equiv="description" content="<?php print $desc; ?>">
<script src="<?php print $do->get_loc(); ?>ads_pb.php" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" media="screen" href="/themes/bluebar/base.css" />
    <!--scripts-->
    <script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript"></script>
    <script src="/themes/bluebar/interface.js" type="text/javascript"></script>
    <!--/scripts-->
</head>

<?php
$location = $do->get_loc();
if($loggedin) {
print <<<COUNT
<body>
    <div id="menu">
//Menu Code//
</div>
    <div id="mainContent">
        <iframe id="iframe" width="100%" height="100%" src="/index.php" frameborder="0">
    </body>
COUNT;
} else {
print <<<CONT
<body>
    <div id="menu">
//Menu Code//
</div>
    <div id="mainContent">
        <iframe id="iframe" width="100%" height="100%" src="/index.php" frameborder="0">
    </body>
CONT;
}
?>
    </div>
Is there any way I can make the menu only load once for the user; or to prevent it from loading in the iFrame?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Hi,

If I understand correctly, your main page and iframe are the same PHP file (index.php). I would suggest making them different PHP files. If that's not possible, then you could pass a GET variable to the index.php to prevent displaying the header/footer:

in t.php:

Code:
<iframe id="iframe" width="100%" height="100%" src="/index.php?noheader=1" frameborder="0">

in index.php:

Code:
if (($_GET['noheader'] != 1) && file_exists(HEADER)) { include_once(HEADER); }
 
0
•••
i agree 100% with qbert220 ;)
 
0
•••
You can check now; I still appear to be having the issue.
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back