PDA

View Full Version : My PHP class is not displaying it's contents the way i need


joop
12-01-2004, 10:37 PM
Hello im moving on gradually with my php lessons, ive started to build (sorry attempting to build) my site by using require(file.php) (or .inc for ease of remembering what file is what).

My contents does not display so good after i have created a header and menu bar. The table for the contents overlaps the menubar slightly.

Can u see why - co's i can't:


<?php
require('page_class.inc');
$homepage = new Page();

$homepage->SetContent("<table width='500' height='300' align='center' border='1'>
<tr>
<td align='center' valign='middle'>
<p>Welcome to Inciter.org.uk, this is a test page.</p>
</td>
</tr>
</table>");

$homepage ->Display();
?>


The above is the code for my simple test.php page.


function Display()
{
echo "<html>\n<head>\n";
$this -> DisplayTitle();
$this -> DisplayKeywords();
$this -> DisplayStyles();
echo "</head>\n<body bgcolor='#FFFFFF' text='#000000' leftmargin='0' topmargin='0'>\n";
$this -> DisplayHeader();
//$this -> DisplayMenu($this ->buttons); //Not in use
$this -> DisplayMenuWithButtons();
echo $this -> content;
$this->DisplayFooter();
echo "</body>\n</html>\n";
}



The above again - is the code that loads each content onto the page.
The echo $this->content; is the part in focus. The other Function in relation to this is:



function SetContent($newcontent)
{
$this->content = $newcontent;
}


Am i really gonna need to format the newcontents? - Please say no lol.

To view the final output goto: http://www.inciter.org.uk/testclass.php

It's weard isn't it lol - it covers the Home button slightly.

joop
12-02-2004, 12:12 AM
Sorry about that - ive done it - The code i post had absolutly nothing to do with it, It was the menu bar - i needed to just add another <TR><TD> hehehe :oops: