HighDots Forums  

how to reference an html page from another html page

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss how to reference an html page from another html page in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chuck [Sbc\)
 
Posts: n/a

Default how to reference an html page from another html page - 03-07-2008 , 11:43 AM






I am new to html programming. I have created a web with 17 different pages.
On each page is a button menu which allow the user to switch to another page
without returning to the home page . The button menu is 40 lines long.
What I would like to do is make a new file "ButtonSub.html " which the
button menu code. I would then remove all of the button codes from each
form . Instead , I would insert a statement that would call ButtonSub.html
to create the button menu on each html.page

Clear as mud???.



Reply With Quote
  #2  
Old   
Ed Mullen
 
Posts: n/a

Default Re: how to reference an html page from another html page - 03-07-2008 , 11:49 AM






Chuck [Sbc) wrote:
Quote:
I am new to html programming. I have created a web with 17 different pages.
On each page is a button menu which allow the user to switch to another page
without returning to the home page . The button menu is 40 lines long.
What I would like to do is make a new file "ButtonSub.html " which the
button menu code. I would then remove all of the button codes from each
form . Instead , I would insert a statement that would call ButtonSub.html
to create the button menu on each html.page

Clear as mud???.


You can do that with a server-side include using PHP or other
technology. That's assuming your Web site's server provides PHP. This
is how I include the same menu on all pages on my site:

<div id="doc_header">
<!-- start menu HTML import-->
<?php include("./styles/menu.txt"); ?>
<!-- END menu HTML import-->
</div>

I use similar markup to put the same footer on each page.

--
Ed Mullen
http://edmullen.net
If man evolved from apes why do we still have apes?


Reply With Quote
  #3  
Old   
Chuck [Sbc\)
 
Posts: n/a

Default Re: how to reference an html page from another html page - 03-07-2008 , 01:11 PM



Ed
I tried but I don't understand what I am to put in ("/styles/menu.txt") My
menu is contained in "ButtonSub.html"
"Ed Mullen" <ed (AT) edmullen (DOT) net> wrote

Quote:
Chuck [Sbc) wrote:
I am new to html programming. I have created a web with 17 different
pages. On each page is a button menu which allow the user to switch to
another page without returning to the home page . The button menu is 40
lines long. What I would like to do is make a new file "ButtonSub.html "
which the button menu code. I would then remove all of the button codes
from each form . Instead , I would insert a statement that would call
ButtonSub.html to create the button menu on each html.page

Clear as mud???.

You can do that with a server-side include using PHP or other technology.
That's assuming your Web site's server provides PHP. This is how I
include the same menu on all pages on my site:

div id="doc_header"
!-- start menu HTML import--
?php include("./styles/menu.txt"); ?
!-- END menu HTML import--
/div

I use similar markup to put the same footer on each page.

--
Ed Mullen
http://edmullen.net
If man evolved from apes why do we still have apes?



Reply With Quote
  #4  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: how to reference an html page from another html page - 03-07-2008 , 01:31 PM



Chuck [Sbc) wrote:
Quote:
Ed
I tried but I don't understand what I am to put in ("/styles/menu.txt") My
menu is contained in "ButtonSub.html"
Then Google is your friend:

http://www.google.com/search?hl=en&q...oogle+S earch
php includes tutorial - Google Search

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #5  
Old   
Ed Mullen
 
Posts: n/a

Default Re: how to reference an html page from another html page - 03-07-2008 , 02:21 PM



Chuck [Sbc) wrote:
Quote:
Ed
I tried but I don't understand what I am to put in ("/styles/menu.txt") My
menu is contained in "ButtonSub.html"
"Ed Mullen" <ed (AT) edmullen (DOT) net> wrote in message
news:9aKdnaSg_56LHUzanZ2dnUVZ_vrinZ2d (AT) comcast (DOT) com...
Chuck [Sbc) wrote:
I am new to html programming. I have created a web with 17 different
pages. On each page is a button menu which allow the user to switch to
another page without returning to the home page . The button menu is 40
lines long. What I would like to do is make a new file "ButtonSub.html "
which the button menu code. I would then remove all of the button codes
from each form . Instead , I would insert a statement that would call
ButtonSub.html to create the button menu on each html.page

Clear as mud???.
You can do that with a server-side include using PHP or other technology.
That's assuming your Web site's server provides PHP. This is how I
include the same menu on all pages on my site:

div id="doc_header"
!-- start menu HTML import--
?php include("./styles/menu.txt"); ?
!-- END menu HTML import--
/div

I use similar markup to put the same footer on each page.

--
Ed Mullen
http://edmullen.net
If man evolved from apes why do we still have apes?


Essentially, substitute your filename for mine. The file should contain
the HTML code for your menu system. If you don't need the div
statements and comments, don't use them. So, the bare-bones code would be:

Quote:
!-- start menu HTML import--
?php include("./yourpath/ButtonSub.html"); ?
!-- END menu HTML import--

--
Ed Mullen
http://edmullen.net
Can vegetarians eat animal crackers?


Reply With Quote
  #6  
Old   
Ed Mullen
 
Posts: n/a

Default Re: how to reference an html page from another html page - 03-07-2008 , 02:27 PM



Ed Mullen wrote:
Quote:
Chuck [Sbc) wrote:
Ed
I tried but I don't understand what I am to put in
("/styles/menu.txt") My menu is contained in "ButtonSub.html"
"Ed Mullen" <ed (AT) edmullen (DOT) net> wrote in message
news:9aKdnaSg_56LHUzanZ2dnUVZ_vrinZ2d (AT) comcast (DOT) com...
Chuck [Sbc) wrote:
I am new to html programming. I have created a web with 17
different pages. On each page is a button menu which allow the user
to switch to another page without returning to the home page . The
button menu is 40 lines long. What I would like to do is make a new
file "ButtonSub.html " which the button menu code. I would then
remove all of the button codes from each form . Instead , I would
insert a statement that would call ButtonSub.html to create the
button menu on each html.page

Clear as mud???.
You can do that with a server-side include using PHP or other
technology. That's assuming your Web site's server provides PHP.
This is how I include the same menu on all pages on my site:

div id="doc_header"
!-- start menu HTML import--
?php include("./styles/menu.txt"); ?
!-- END menu HTML import--
/div

I use similar markup to put the same footer on each page.

--
Ed Mullen
http://edmullen.net
If man evolved from apes why do we still have apes?



Essentially, substitute your filename for mine. The file should contain
the HTML code for your menu system. If you don't need the div
statements and comments, don't use them. So, the bare-bones code would be:

!-- start menu HTML import--
?php include("./yourpath/ButtonSub.html"); ?
!-- END menu HTML import--


To expand, the contents of the ButtonSub.html file will be taken by the
PHP and inserted on the fly by your server. So, if you go to a page and
use the View Source command you won't see the include statement, you
will see the code from ButtonSub.html as though it were hard-coded into
each html document. In my case, 142 lines of code for the menu system
do not exist in each page file: They are inserted by the server on the
fly by that single PHP "include" statement in each page file. Kay?

--
Ed Mullen
http://edmullen.net
And whose cruel idea was it to put an S in the word Lisp?


Reply With Quote
  #7  
Old   
Chuck [Sbc\)
 
Posts: n/a

Default Re: how to reference an html page from another html page - 03-08-2008 , 09:08 PM



Jonathan
Thanks - your suggested site was perfect. I made changes to all my pages
(17) and the master menu file in just over 3 hours.
I reduced my file storage by 65%.
Thanks Again
Chuck


"Jonathan N. Little" <lws4art (AT) central (DOT) net> wrote

Quote:
Chuck [Sbc) wrote:
Ed
I tried but I don't understand what I am to put in ("/styles/menu.txt")
My menu is contained in "ButtonSub.html"

Then Google is your friend:

http://www.google.com/search?hl=en&q...oogle+S earch
php includes tutorial - Google Search

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com



Reply With Quote
  #8  
Old   
Chuck [Sbc\)
 
Posts: n/a

Default Re: how to reference an html page from another html page - 03-08-2008 , 09:17 PM



I don't know "Please don't top-post"
Elucidate
..



"Beauregard T. Shagnasty" <a.nony.mous (AT) example (DOT) invalid> wrote

Quote:
Chuck [Sbc) wrote:

I tried but I don't understand what I am to put in ("/styles/menu.txt")
My
menu is contained in "ButtonSub.html"

div id="doc_header"
!-- start menu HTML import--
?php include("./path/to/ButtonSub.html"); ?
!-- END menu HTML import--
/div

A URL for your site would help with any further answers.

Please don't top-post.

--
-bts
-Friends don't let friends drive Vista



Reply With Quote
  #9  
Old   
Blinky the Shark
 
Posts: n/a

Default Re: how to reference an html page from another html page - 03-08-2008 , 09:31 PM



Chuck [Sbc) wrote:

Quote:
I don't know "Please don't top-post"
Don't POST on TOP of what you're responding to.


--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Blinky: http://blinkynet.net



Reply With Quote
  #10  
Old   
Chuck [Sbc\)
 
Posts: n/a

Default Re: how to reference an html page from another html page - 03-09-2008 , 12:40 AM



I'm new to this Group stuff...
I have no idea what the heck you are talking about.
what does > Don't POST on TOP of what you're responding to. < mean???
Quote:

"Blinky the Shark" <no.spam (AT) box (DOT) invalid> wrote

Quote:
Chuck [Sbc) wrote:

I don't know "Please don't top-post"

Don't POST on TOP of what you're responding to.


--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Blinky: http://blinkynet.net




Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.