Home page contents must occur in every link that is opened

This is a discussion on "Home page contents must occur in every link that is opened" within the Web Page Design section. This forum, and the thread "Home page contents must occur in every link that is opened are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Oct 16th, 2007, 10:12
New Member
Join Date: Oct 2007
Location: vasai
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Home page contents must occur in every link that is opened

Hi,

I have designed a website. On my home page, logo is there at top, below that horizontal menu, vertical menus are there on the left and footer at the bottom. The body part is blank as of now.

I want that whenever i click on any of the link on the menu that particular link must be opened in the body part and i want the logo, horizontal menu, vertical menu and footer to appear on that page as they are on the home page. I want this to happen on whatever link i click. I have created website in HTML only and used CSS for style. Please help me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 16th, 2007, 10:18
Marc's Avatar
Staff Manager

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 1,765
Thanks: 0
Thanked 14 Times in 14 Posts
Re: Home page contents must occur in every link that is opened

Can we see the code of your website and/or an example?
__________________
Marc
Staff Manager - Webforumz.com


Want to be a moderator? PM me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 16th, 2007, 11:18
New Member
Join Date: Oct 2007
Location: vasai
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Home page contents must occur in every link that is opened

hi , i have attached zip file of my project. You can open the index.html file and see the site.
Attached Files
File Type: zip website 2.zip (489.3 KB, 2 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 16th, 2007, 12:33
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Home page contents must occur in every link that is opened

Please provide a link instead as it is much easier to get help this way.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 16th, 2007, 16:00
New Member
Join Date: Oct 2007
Location: vasai
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Home page contents must occur in every link that is opened

i havent uploaded it yet. still doing offline only. thats why i have attached the file which have details .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 16th, 2007, 16:45
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Home page contents must occur in every link that is opened

Nobody will want to download it,
just put it on freewebs or some other free host!
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 16th, 2007, 17:19
Highly Reputable Member
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Home page contents must occur in every link that is opened

You could use php to acheive this. That way you only need the one file as the index page and the only thing that changes is the content

This is a very basic version of what you could do
PHP: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
</head>
<body>
<div id="wrapper">
    <div id="header"></div>
    <div id="nav">
 <ul>
     <li><a href="index.php?page=firstpage">First page</a></li>
     <li><a href="index.php?page=secondpage">Second page</a></li>
     <li><a href="index.php">Home</a></li>
 </ul>
    </div>
    <div id="content3" class="style1">
     <?php
  
switch ($_GET['page'])
      {
      
//Main website pages
      
case "firstpage":
   include(
'firstpage.php');
   break;
      case 
"secondpage":
   include(
'secondpage.php');
   break;
      default:
   include(
'home.php');
      }
     
?>
    </div>
    <div id="footer"></div>
</div>
</body>
</html>
You would save this as index.php and for all of your other content, you just need to put in the html that would go in the content div so there is no need to use <html> etc

example of firstpage.php and the same for any other pages including home.php

PHP: Select all

<h1>First page</h1>
<
p>This is page one</p
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 16th, 2007, 18:10
New Member
Join Date: Oct 2007
Location: vasai
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Home page contents must occur in every link that is opened

my website address is http://www.freewebs.com/luckyros
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 17th, 2007, 10:04
New Member
Join Date: Oct 2007
Location: vasai
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Home page contents must occur in every link that is opened

Quote:
Originally Posted by AdRock View Post
You could use php to acheive this. That way you only need the one file as the index page and the only thing that changes is the content

This is a very basic version of what you could do
PHP: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
</head>
<body>
<div id="wrapper">
    <div id="header"></div>
    <div id="nav">
 <ul>
     <li><a href="index.php?page=firstpage">First page</a></li>
     <li><a href="index.php?page=secondpage">Second page</a></li>
     <li><a href="index.php">Home</a></li>
 </ul>
    </div>
    <div id="content3" class="style1">
     <?php
  
switch ($_GET['page'])
      {
      
//Main website pages
      
case "firstpage":
   include(
'firstpage.php');
   break;
      case 
"secondpage":
   include(
'secondpage.php');
   break;
      default:
   include(
'home.php');
      }
     
?>
    </div>
    <div id="footer"></div>
</div>
</body>
</html>
You would save this as index.php and for all of your other content, you just need to put in the html that would go in the content div so there is no need to use <html> etc

example of firstpage.php and the same for any other pages including home.php

PHP: Select all

<h1>First page</h1>
<
p>This is page one</p
I am unable to get what you are trying to tell. Please explain me in simple words. you can visit my uploaded website at http://boisl.topcities.com then you will be able to know what i am trying to tell. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Oct 17th, 2007, 12:44
Highly Reputable Member
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Home page contents must occur in every link that is opened

Your link doesn't work.....

First of all, you need to make sure the server supports php

In the example i gave, that is your index page so you would call that index.php becuase it has php in the code. This page is the only page which has all your links and page structure in it so you'll be fine with the page you have but you just need to call it index.php

Where ever you have a link you need to put index?page= and the name of the page you want to direct to. So if you wanted to go to the contact page you would put index.php?page=contact. This goes for all of you links.

When you click a link, the url
index.php?page=contact gets put in the address bar and the browser reloads the index page and as the code is getting read, it comes across the switch statement which would be in the div where you want your content to change

PHP: Select all

<?php
  
switch ($_GET['page'])
      {
      
//Main website pages
      
case "firstpage":
   include(
'firstpage.php');
   break;
      case 
"secondpage":
   include(
'secondpage.php');
   break;
      default:
   include(
'home.php');
      }
     
?>
what it does is come to the $_GET in the switch and it looking for the page variable in the address bar which would be contact becuase it's page=contact.

Now its got the page name whcih would be contact, it goes down the next part which is include the page contact.php or contact.htm

If you notice at the bottom there is default: what's included in there is the default page so when you first view the page, there is a default page to include.

Just remember that your page name after the index.php?page= is the same as in the switch statement.

If you have any more questions just ask
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any ideas for my home page Oak Website Planning 4 Feb 6th, 2008 00:30
My home page doesn't show spacefonkey Starting Out 4 Jun 28th, 2007 21:02
Home page hello123 Starting Out 4 Feb 13th, 2007 14:40
Make this my home page joshcxa JavaScript Forum 2 May 22nd, 2006 06:16


All times are GMT. The time now is 11:23.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42