Weborum Webmaster Forum > Simple HTML/Php
Help - Search - Members - Calendar
Full Version: Simple HTML/Php
Weborum Webmaster Forum > Web Page Design > PHP
bte
Hi guyes, first time here, first post.

First off, i am at a basic stage of HTML/PHP. I have learned the most basic commands, creating a page in BASIC HTML is no problem.

BUT, i want to use the php INCLUDE command in my training.

Here is the code for my training project, Index. html:

<html>
<head>
<title> This is tha ######z </title>
</head>
<body>

<table border="0" width="60%">
<tr>
<td width="25%" bgcolor="gray">
<p>Insert logo or text here</p>
<td bgcolor="gray">Insert Logo here</td>
</table>

<table border="0" width="60%">
<tr><td valign="top" width="25%" bgcolor="lightblue">
Index<br>
Downloads<br>
Contact<br>
</td> <td valign="top" width="75%">This is the body, insert all useless information here!<br>
Including news and so on<br>

</td> </tr>

<footer>
<table border="0" width="60%">
<tr>
<td bgcolor="gray"><center><font size="1">Copyright bt™</font></center></td>

It is built in tables, the menu and "this is the body" is the same table.. I want the menu to include the links in "this is the body"..

I dont know if you guyes understand what i mean but it's kind of hard to explain..
Joe
include.php
CODE
This is the body, insert all useless information here!
<br>
Including news and so on<br>


yourpage.php
PHP
<html>
<head>
<title> This is tha ######z </title>
</head>
<body>

<table border="0" width="60%">
<tr>
<td width="25%" bgstyle="color:gray">
<p>Insert logo or text here</p>
<td bgstyle="color:gray">Insert Logo here</td>
</table>

<table border="0" width="60%">
<tr><td valign="top" width="25%" bgstyle="color:lightblue">
Index<br>
Downloads<br>
Contact<br>
</td> <td valign="top" width="75%"><?php include 'include.php'; ?>

</td> </tr>

<footer>
<table border="0" width="60%">
<tr>
<td bgstyle="color:gray"><center><font size="1">Copyright bt™</font></center></td>


HTH smile.gif Welcome to the forums
bte
CODE
<table border="0" width="60%">
<tr><td valign="top" width="25%" bgstyle="color:lightblue">
Index<br>
Downloads<br>
Contact<br>
</td> <td valign="top" width="75%"><?php include 'include.php'; ?>



This is the menu/link section, i just have not added the links to them yet..

But how do i make each link show up in (as you wrote it) "Include.php"?

As it is now, only the Include.php file will show there.. I want the links Downloads, contact, and any other link i may create show up there aswell...

Is that possible?
leo
you need to put all your links inside the include file, the page your using the include on needs to be .php for it to work, not .html
bte
Its hard for me to explain, i am sorry sad.gif

when i PRESS the link's, i want the text to show up in the next <td> from where the menu is...
leo
ahhh, i see what you mean now.

when you click a link all the content is to appear in the center table cell, ok.

that's a different story, you're trying to do frames not includes.

in your center table cell put this

CODE

<iframe name="content" src="page.html" style="height:100%;width:100%;"></iframe>


and then for the links to open the pages inside that iframe you need to "target" them to the iframe name

CODE

<a href="page.html" target="content">Click here</a>


that will open the page page.html in the frame

hope that's what you are after smile.gif
bte
I guess that's what i am after smile.gif

Thanks!
bte
By the way, is it possible to make the ifram totally invisible?
I can see the edges, and it annoying me tongue.gif
leo
hehe, add this in between your <head> tags

CODE

<script type="text/javascript">
window.onload = function() {
document.getElementById('content').contentWindow.document.body.style.border = 0
}
</script>


Replace content with the name of your iframe, and then add frameborder="0" to your iframe line smile.gif

Willy Duitt
IE does not play well with style="border:none;margin:none"
So you must use FRAMEBORDER="0" if you do not have access to the source of the page which is included in the iframe (or use Leo's javascript suggestion to change the src style at runtime)

However, since you do have access to the source of your menu include.php...
Just add style="border:none;margin:none" either directly to the body tag or style declaration of the include file... This way your document will suppress borders and margins for those with javascript disabled...

.....Willy
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.