Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Connect the menu with container using divs
Old 12-19-2009, 02:11 PM Connect the menu with container using divs
Novice Talker

Posts: 13
Name: denis
Trades: 0
Hi there! I wasn't here from a long time and i wanna debate a little problem. Since the forum is really big i hope i posted in the right section and the problem wasn't debate until now..

So i'm a beginer in html/css stuff and i have a problem: i just created a menu but i don't know how to connect the menu with the "container". I divided the whole site in divs. At the moment i have 3 divs: Banner, Menu and container..the thing is: how can i connect the web pages with the menu without writing whole site in 1000 html pages (suposing that my site will have a big number of html pages, i want to have the banner, the footer and the rest code write in a single html page....and in the rest html pages to write just the necesary code, without the banner and the footer again).

example:

index.html:

HTML Code:
 
<html>
<head>
<meta tag bla bla>
</head>
<body>
<div class=banner>
img a href...
</div>
 
<div class=menu>
<ul>
<li><a href="index.html>HOME</a></li>
<li><a href="videos.html">VIDEOS</a></li>
</ul>
</div>
 
<div class=footer>
img a href..
</div>
 
</body>
</html>
 
</code>
 
 
and the videos.html:
 
<html>
<head>
</head>
<body>
<div class=container>
here we post the videos.
</div>
</body>
</html>
I hope u understand what i want..in the videos.html i dont wanna write again the footer and the rest page..just the important content.

I tried before with frames, but i dont like because the top frame (where the menu we supose it it) it remain fixed..and the main frame is scrolling..and i want all page to scrol down/up not just the main frame..and anyway i thing it is an old method..better with divs


Well i hope u understant my problem..and sorry for my enghlish

Last edited by chrishirst; 12-19-2009 at 02:14 PM..
Dennys08 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-20-2009, 04:50 AM Re: Connect the menu with container using divs
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
You can do what you want in php code. This will allow you to create what are called 'Dynamic Pages'. If you ever seen a site where the url (link) would look something like:

Code:
http://thisdomain.com/index.php?id=1
That's a dynamically generated page ( id=1 ) and is stored in a database. MySQL db is pretty popular, then there's also MS SQL. Both handle this functionality quite well. You would only have to create a header and a footer, and the php code would be inter-changeable from the php code and or database, and in variable form such as $var.

Good luck
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 12-20-2009 at 04:54 AM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 12-20-2009, 02:36 PM Re: Connect the menu with container using divs
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
i want to have the banner, the footer and the rest code write in a single html page
What you NEED is known as server-side includes, which you can do with PHP as Brian noted above.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-20-2009, 03:50 PM Re: Connect the menu with container using divs
Novice Talker

Posts: 13
Name: denis
Trades: 0
Yes thank you didn't knew that this means dinamic pages :P.
Well i created the following pages index.php, menu.php, top.php, contact.php, about.php ..but i still have a problem..where i show the content ?

index.php:
Code:
<body>  

<br/><br/>

<center>

<div class="top">
<?php include_once('inc/top.php'); ?>
</div>

<br/><br/>

<div class="menu">
<ul>
<?php include_once('inc/menu.php'); ?>    
</ul>
</div>

<div class="body">
???? /// how i make here apear what i want? under the menu..
</div>


</center>

</body>
top.php:

Code:
 
<IMG SRC="poze/FundalLung.jpg" WIDTH="567" HEIGHT="113" BORDER="0" ALT="">
menu.php:

Code:
<ul>
<li><a href="contact.php">Contact</a></li>
<li><a href="about.php">About</a></li>
</ul>
contact.php:
Code:
 <br/> CONTACT
about.php:
Code:
 <br/> ABOUT
Pls make me understant how is this working
Dennys08 is offline
Reply With Quote
View Public Profile
 
Old 12-23-2009, 06:38 AM Re: Connect the menu with container using divs
Novice Talker

Posts: 13
Name: denis
Trades: 0
or at least any idea how to organize them in folders?
Dennys08 is offline
Reply With Quote
View Public Profile
 
Old 12-23-2009, 06:47 AM Re: Connect the menu with container using divs
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
If you really want to have dynamic pages, you will need a database connection. Since you say you are a beginner I wouldn't worry about this just yet. Use server side includes, and just create separate, static pages. This will still have a great advantage because you will be able to update only one file at a time and affect the entire site.

So create index.php, about.php, whatever.php, etc. which all use the same common includes such as the menu, top, footer, and so on.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 12-23-2009, 12:32 PM Re: Connect the menu with container using divs
Novice Talker

Posts: 13
Name: denis
Trades: 0
yes i understood this, but i have a problem: at me this works only if i put all php files in same folder.for example:

folder : - file.php
-file2.php
- folder - file3.css

i can't put the includes files in a folder, the other php files in another folder, cauz i get an error that says something that it cant find the files.. thats why im asking..
Dennys08 is offline
Reply With Quote
View Public Profile
 
Old 12-23-2009, 01:25 PM Re: Connect the menu with container using divs
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
You can either use relative syntax to include files in different directories:
PHP Code:
<?php
include "../inc/head.php";
//one level back, then in the /inc/ directory
?>
Or you can use the document root, which is a sure fire way to know you're including from the base of the web tree:
PHP Code:
<?php
include $_SERVER["DOCUMENT_ROOT"]."/inc/head.php";
//one level back, then in the /inc/ directory
?>
Any path that starts with a "/" is from the root directory, but the reason you wouldn't express this path simply "/inc/head.php" is that the real path begins below the public root. $_SERVER["DOCUMENT_ROOT"] automatically calculates this for you.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 12-24-2009, 04:25 AM Re: Connect the menu with container using divs
Novice Talker

Posts: 13
Name: denis
Trades: 0
pfff..thank you very much! now its working..i really forgot the part with the root..thank you
Dennys08 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Connect the menu with container using divs
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.29110 seconds with 12 queries