How do I force include page to import at the BOTTOM of page?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
camarosource
Forum Commoner
Posts: 77
Joined: Sat Aug 03, 2002 10:43 pm

How do I force include page to import at the BOTTOM of page?

Post by camarosource »

I am trying to use the "INCLUDE" statement to import a html file into one of my other html files. The php file loads the first html file, and then in the php I have an INCLUDE statement to append an outside html into the first html file.

This is what I have in the php file:

include('' . $year . '.htm');

It is importing the outside html file sucessfully HOWEVER its importing it at the TOP of the page rather than the BOTTOM. I need the outside html page to append to the BOTTOM of the first..

How do I do this??
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Post by Steveo31 »

You could do:

Code: Select all

<div id="bottom" align="center"> 
  <?php include('bottomPage.php'); ?>
</div>
and the CSS for id="bottom":

Code: Select all

/* CSS Document */

#bottom &#123;
	position:absolute;
	bottom:0%;
&#125;
User avatar
no_memories
Forum Contributor
Posts: 145
Joined: Sun Feb 01, 2004 7:12 pm
Location: New York City

Post by no_memories »

This is one way; look for <?php require("loadtime.php"); ?>. Just make sure your link points to the external php file. In all actuality, the PhP should be completely outside the markup, but that's a bit beyond the scope of this question.

Code: Select all

&lt;div id="f"&gt;
&lt;span&gt;&lt;a href="http://validator.w3.org/check/referer" title="Validated xHTML 1.1"&gt;xHTML 1.1&lt;/a&gt;&lt;/span&gt;
| &lt;span&gt;&lt;a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validated CSS 2"&gt;CSS 2&lt;/a&gt;&lt;/span&gt;
| &lt;span&gt;&lt;a href="/" title="Bobby AAA/508 Approved"&gt;AAA/508&lt;/a&gt;&lt;/span&gt;
| &lt;span class="green"&gt;&lt;?php require("loadtime.php"); ?&gt;&lt;/span&gt;
| &lt;span class="crimson"&gt;Optimized for 800x600&lt;/span&gt;
&lt;/div&gt;
now, the <?php require("loadtime.php"); ?> is linked to this code; an external php file:

Code: Select all

<?php
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$time_start = getmicrotime();
for ($i=0; $i <1000; $i++){
}
$time_end = getmicrotime();
$time = $time_end - $time_start;
$time = round($time,6);
echo "Load Time: $time sec."; //you can edit the "Load Time:"
?>
The same can be done with pieces of markup as well, splitting up the header, content, and footer, then calling them in dynamically using php.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Moved to the Clientside forum. This is not a PHP issue but rather an HTML one - you need to structure your HTML so that the included file appears in the correct place.

Mac
User avatar
johnperkins21
Forum Contributor
Posts: 140
Joined: Mon Oct 27, 2003 4:57 pm

Post by johnperkins21 »

These seem to be overly complex ideas.

If you just want it at the bottom of a simple page:

Code: Select all

<html>
<head></head>
<body>
HTML stuff
more HTML stuff

<?
include "yourfile";
?>

</body>
</html>
Alternatively you could us frames or an iframe element. Heck, even a table would work. Just think of the include as copying and pasting your file into the parent file and structure your page that way.
Post Reply