Jump to content

Substitute for Frames


Soraka

Recommended Posts

Hey everyone.

I've been working on a PHP script-ish site, where i've also included frames.

There's a problem now that people using IE got a problem with that the frames do not work (page loading in the wrong frame) and i was wondering if anyone knows a substitute or workaround for frames, i'd love to know.

 

This is the code.

<html>
<head>
<title></title>

<?php /* ------------------------- */

  if(isset($_COOKIE['login'],$_COOKIE['validate'])) {
    setcookie("login",$_COOKIE['login'],time()+24*60*60,"/","");
    setcookie("validate",$_COOKIE['validate'],time()+24*60*60,"/","");
  }
  include("functies.php");
  include("_include-config2.php");
  include("ban.php");

/* ------------------------- */ 
  if($data) {
?>

		<frameset  rows="143,*" border="0">
			<frame name="topbanner" src="header.php" marginwidth="10" marginheight="10" scrolling="no" frameborder="0" noresize>
			<frameset  cols="15%,*,15%" border="0">
				<frame name="menu" src="menu.php" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0" noresize>
				<frame name="I1" src="status.php" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0" noresize>
				<frame name="news" src="menu2.php" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0" noresize>
			</frameset>
		</frameset></head><body>

<?php
  }
  else {
?>
</head>
<body>
<link href="style2.css" rel="stylesheet" type="text/css">
<base target="I1" />

    <tr>
      <center><td width="762"><IMG SRC="images/xw.jpg" WIDTH=760 HEIGHT=129 ALT=""></td></center>
    </tr>
<br><br>
<table align=center width=500>
  <tr><td class=subTitle><b></b></td></tr>
  <tr><td class=mainTxt>

<table class=td cellpadding=0 cellspacing=0 width=500><tr>

     <td width=15></td>



      <td valign="top">
        <iframe src="<?php if($data){ 
	$frame  = "hq.php";
	} elseif($_COOKIE['baas'] !=""){
	$frame  = "signup.php";
	} else{
	$frame  = "login.php";
	}
	print $frame ?>" name="I1" width="500" height="275" frameborder=0></iframe></td>
                  </table></td>
                </tr>




<?php
}
?>
<?php include("foot.php"); ?>
</html>

My problem lies with the Menu1.php and the Menu2.php, as what the buttons pressed in the menu doesn't go to frame name I1 (Status.php) but in their own frames.

 

Thanks for your help,

Soraka

Link to comment
https://forums.phpfreaks.com/topic/191784-substitute-for-frames/
Share on other sites

I tend to use (depending on the situation) instead of frames, divisons. You could use div's and use css to create a table like environment. Basically creating a box model, here is a good reference. It may take some learning if your are not familiar with it, but trust me if you learn it and like it you'll love it. Some prefer it, some don't but I love using that instead of tables and frames. Makes life grand in a dynamic setup. Of course have to be careful and check your browsers there are a lot of quirks, but w3 schools site has a good technical explanation. Also if you like these do some googling about it and find a lot of resources.

<url>http://www.w3schools.com/css/css_boxmodel.asp</url>

Alternatively you could read up on server side includes SSI.

 

http://en.wikipedia.org/wiki/Server_Side_Includes#Most_common_directives

 

It will make your life easier.

 

That is actually what I prefer to use. This place here:http://woork.blogspot.com/2007/10/load-page-using-url-variables-and-php.html also gives good examples of how to setup a site with includes. A discussion followed with different techniques in the comment section, of which I based most of my modeling system not on that site official explanation but a mix of the commenting peoples suggestion.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.