Page 1 of 1

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

Posted: Sat Apr 03, 2004 11:28 pm
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??

Posted: Sat Apr 03, 2004 11:55 pm
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;

Posted: Sun Apr 04, 2004 4:18 am
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.

Posted: Mon Apr 05, 2004 3:53 am
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

Posted: Mon Apr 05, 2004 11:44 am
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.