Hello ,
I'd like to know how to make a layout of this type:
http://stargazr.netg.se/tuts/
I would know how to make such a layout in html but I'm clueless in php :(
Someone help please.
Sillyish
03-17-2006, 12:00 PM
php doesn't actually REPLACE html, so I'm not 100% sure what you mean :P
allie
03-17-2006, 01:06 PM
You can use tables or divs to make a layout like that. The site you mentioned uses a combination of both :D
thank you :) What I mean is what to put in the footer.php & what to put in the header.php ?
Phillip
03-17-2006, 05:33 PM
It's quite simple, your boxes around each page will go in here.
Then you div your page where the pages will load:
<div align="center" id="Main">
</div>
then in your footer add whatever you like, copyright help links anything!
The only thing you need to think about on the header is:
<title><?php echo $page_title; ?></title>
Then create your home page:
<?php
$page_title = 'Home';
include ('header.html');
?>
<p>hey hey hey hey hey hey hey hey hey hey</p>
<?php include ('footer.html'); ?>
Wermaus
03-17-2006, 05:34 PM
Hi!
You can put the doctype declaration and the <html><head>....in the header-file and the </body></html> and maybe a copyrightline into the footer-file.
Then you include the files at the proper places.
Remember to use .php as a fileextension for your page when you use PHP!
Thank you guys ! I'll follow your instructions and see what I come up with !
So I tried something :
my code for header.php
<html>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<body >
<div id="Layer1" align="left"></div>
<title><?php echo $page_title; ?></title>
<table width="650" height="1689" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="158" colspan="5">
<table width="423" height="159" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20" background="mainfiles/bgleft.jpg"> </td>
<td width="403"><img src="mainfiles/mainpic1.jpg" width="270" height="355"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="20" background="mainfiles/bgleft.jpg"> </td>
<td width="430" valign="top" bgcolor="AACFDE"> </td>
<td width="15" background="mainfiles/bgmid.jpg"> </td>
<td width="162" valign="top" bgcolor="CEE4ED"> </td>
<td width="20" background="mainfiles/bgright.jpg"> </td>
</tr>
</table>
my code for footer.php:
</BODY>
</HTML>
my code for index.php
<?php
$page_title = 'Home';
include ('header.php');
?>
<p>hey hey hey hey hey hey hey hey hey hey</p>
<?php include ('footer.php'); ?>
-------------------------------------------------------------------------
The table appears well but something funny happens ! The text :"hey hey hey " appears after the table . I don't know why?
Wermaus
03-18-2006, 10:43 AM
Hi!
Take a look at the html-sourcecode in your browser:
You closed the table already in the header with </table> so the following text is displayed after the table.
If you want your text to appear inside the table, move the ending tags of the table in your index.php from the header to the end of the text.
Thanks.I tried what you said but still the text doesn't appear where it has to ?
Text appears after the table as shown in pic:
http://img211.imageshack.us/img211/9276/lay7qt.jpg
Phillip
03-18-2006, 12:49 PM
Hey, try aligning where you want the files to go maybe at the bottom of the actuall header page? :)
Wermaus
03-18-2006, 01:45 PM
Hi!
Can you post a link to your page so we can have a look at the sourcecode to help you?
Here's a link to my page :
http://fansites.hollywood.com/~rani/test.php
as you can see the text still goes at the bottom of the table.
Wermaus
03-18-2006, 02:32 PM
Hi rani!
Your sourcecode is <body >
<html>
.
.
.
.
<title>Home</title>
<table width="650" height="1689" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="158" colspan="5">
<table width="423" height="159" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20" background="mainfiles/bgleft.jpg"> </td>
<td width="403"><img src="mainfiles/mainpic1.jpg" width="270" height="355"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="20" background="mainfiles/bgleft.jpg"> </td>
<td width="430" valign="top" bgcolor="AACFDE"> </td>
<td width="15" background="mainfiles/bgmid.jpg"> </td>
<td width="162" valign="top" bgcolor="CEE4ED"> </td>
<td width="20" background="mainfiles/bgright.jpg"> </td>
</tr>
</table> content here !!!!!!!!!!!
</BODY>
</HTML>
Your table code is wrong;for every opening tag ) like <table>( there should be a closing tag )like </table>( too.
Do you want only one table?
Then you must not use <table>......</table> more than once.
The content must go between this, inside a <td>-tag like you did it here:
<tr>
<td width="20" background="mainfiles/bgleft.jpg"> </td>
.
.
.
.<td>Your content here.....</td>
</tr>
Still can't get it to work ?