Jump to content

Recommended Posts

Frames are terrible. They are cumbersome to use and they make bookmarking pages damn near impossible (for the average user.)

 

Are you wanting to use a templated page? Where all content opens in a particular spot and your header / menu sections stay the same?

 

Is this what your after?

 

Link to comment
https://forums.phpfreaks.com/topic/53188-web-pages/#findComment-262770
Share on other sites

something like that yeah

i have a logo which i always want to stay at the top

i have links on the index page, but when i click a couple of them i want them to load up where the original ones were

and the rest of the pages i want to load up in a seperate area, which in the frames would be the mainframe

Link to comment
https://forums.phpfreaks.com/topic/53188-web-pages/#findComment-262771
Share on other sites

Depending on the complexity....

 

this can be your template

<?php
function top($links) {
  echo "header stuff";
  if($links == 1) {
    echo "links to show";
  }elseif($links == 2)
    echo "links to show";
  }
}

function bottom() {
echo "© 2007 Whatever";
}

 

 

now any file you have do this

 

<?php
include("template.php");
//change the 1 to 2, if you want to display something different at the top.
top("1");

echo "this is the body of the page";

bottom();
?>

 

since youre just getting started, this should help you out somewhat

Link to comment
https://forums.phpfreaks.com/topic/53188-web-pages/#findComment-262774
Share on other sites

Here is how I do the template thing.

 

header.php

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>Untitled Document</title>
</head>

<body>
    <!-- All Content Loads Here -->
<?php function footer(){ ?>

</body>
</html>
<?php } ?>

 

 

Other pages

 

<?php include('header.php') ?>

some content 
some more content

<?php footer() ?>

 

 

THis is a crude example, but it is the same principle. The header.php page wraps around the other pages by way of the include and by making the lower part of code a footer function.

 

I use table layouts still, and I incorporate this inside the tables so one particular cell is where all my code loads up at. And by doing this you can simply make links to all your css, and other items you want included in all pages.

 

Hope this helps,

 

Nate

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/53188-web-pages/#findComment-262797
Share on other sites

You need to load even the index page inside the table.

 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>Untitled Document</title>
</head>

<body>

   <table width="100%" cellpadding="0" cellspacing="0">
      <tr colspan="2"><td>Banner Goes Here</td></tr>

<tr><td>Menu Here</td>
<td>

    <!-- All Content Loads Here -->
<?php function footer(){ ?>


</td>
</tr>
<tr><td colspan="2">FOOTER HERE</td></tr>
</table>


</body>
</html>
<?php } ?>

 

 

I am not using my normal methods of writing this, so I may have made a typo or 2.

 

Call this page header.php or whatever you want, and then call it like I showed you earlier. Then your index.php and all other pages will be loaded in content cell.

 

This table layout produces a 3 row 2 column table.

 

            Header

 

Menu                Content

 

          Footer

 

Everything will load in the spot marked content.

Link to comment
https://forums.phpfreaks.com/topic/53188-web-pages/#findComment-262882
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.