Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Possible to Insert One HTML Doc Into Another?

Reply
Thread Tools

Possible to Insert One HTML Doc Into Another?

 
 
Pavlik Morosov
Guest
Posts: n/a
 
      08-07-2005
Is it possible to load an HTML document into the main HTML document, much
like inserting a graphic?

Could one have, say, a "header.htm" file that could be coded to load into
any page on my site?

If this is a dumb question, sorry, but it's the only work-around I can
think of for a problem I'm trying to figure out.

Thank you for any help!
http://www.e-mail.ru
E-MAIL.RU
http://www.e-mail.ru

15 " " 20% ! .
Tel/fax: (095) 784-64-84
URL: http://www.kpk.ru

 
Reply With Quote
 
 
 
 
Safalra
Guest
Posts: n/a
 
      08-07-2005
Pavlik Morosov wrote:
> Is it possible to load an HTML document into the main HTML document, much
> like inserting a graphic?
> Could one have, say, a "header.htm" file that could be coded to load into
> any page on my site?


If your host supports server-side includes, they'd be the ideal
solution. The only other thing I can think of (other than using
iframes) is using a preprocessor before uploading pages, but then you'd
have to update them all every time the page changes, which rather
defeats the point.

--
Safalra (Stephen Morley)
http://www.safalra.com/hypertext/

 
Reply With Quote
 
 
 
 
Spartanicus
Guest
Posts: n/a
 
      08-07-2005
Pavlik Morosov <(E-Mail Removed)> wrote:

>Is it possible to load an HTML document into the main HTML document, much
>like inserting a graphic?
>
>Could one have, say, a "header.htm" file that could be coded to load into
>any page on my site?


That suggests that instead of inserting a (complete) HTML document you
want to insert a HTML code fragment instead. Both are possible but
fundamentally different techniques.

http://www.allmyfaqs.com/faq.pl?Incl...ile_in_another

--
Spartanicus
 
Reply With Quote
 
Tina - AxisHOST, Inc.
Guest
Posts: n/a
 
      08-07-2005
"Pavlik Morosov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is it possible to load an HTML document into the main HTML document, much
> like inserting a graphic?
>
> Could one have, say, a "header.htm" file that could be coded to load into
> any page on my site?



See bignosebird.com/ssi.shtml for instructions on SSI (Server Side
Includes).

--Tina
--
http://www.AxisHOST.com - Serving the web since 1997
Very Generous Cpanel Hosting & Fully Managed Servers
Newsgroup 20% Discount Code: newsgroup


 
Reply With Quote
 
Morosov
Guest
Posts: n/a
 
      08-08-2005
[Third try to get a response posted - sorry if duplicates
appear later!]

OK, thanks for the help so far!

So, is this really as simple as it looks with SSI or PHP?

Just one command inserted and changing the extension of the
file to .php or .shtml?

If so...wow...all the time I've wasted! 8-(

I will have a site of many articles, and I want to be able
to deep-link to them without having them orphaned from rest
of the site. I want to have a single, somewhat complex header
(though small in size) that will be at the head of every page
on the site and which will be constantly maintained and updated
independent of the archived articles. Let's call it...

header.htm

So, if I have a PHP capable provider, all I have to do with
each article page is stick the code...

<?php include("header.htm"); ?>

Up in the top of the page someplace and save the page with a
.php extension?

Is that it? And if the site has SSI rather than PHP I can do
something similar, as described in the page for .shtml files?

I hope I'm understanding this right! Seems too easy!

If this is correct and I have the choice between PHP and SSI,
if there any reason to pick one over the other?

Thanks for any additional clarifications.

===

-=-
This message was sent via two or more anonymous remailing services.




 
Reply With Quote
 
Safalra
Guest
Posts: n/a
 
      08-08-2005
Morosov wrote:
> [snip]
> So, if I have a PHP capable provider, all I have to do with
> each article page is stick the code...
> <?php include("header.htm"); ?>
> Up in the top of the page someplace and save the page with a
> .php extension?
> Is that it? And if the site has SSI rather than PHP I can do
> something similar, as described in the page for .shtml files?
> I hope I'm understanding this right! Seems too easy!


<philosophy>It's interesting that people are so sceptical that an easy
to state problem should have an easy to implement
solution.</philosophy>

> If this is correct and I have the choice between PHP and SSI,
> if there any reason to pick one over the other?


I'd go with SSI for anything that doesn't require PHP features. I
believe it is parsed slightly faster because of its simpler syntax (I'm
sure someone will correct my if I'm wrong). Plus more hosts support SSI
(with no security issues) than PHP (with some security issues).

--
Safalra (Stephen Morley)
http://www.safalra.com/hypertext/

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      08-09-2005
Safalra wrote:

> I'd go with SSI for anything that doesn't require PHP features. I
> believe it is parsed slightly faster because of its simpler syntax (I'm
> sure someone will correct my if I'm wrong). Plus more hosts support SSI
> (with no security issues) than PHP (with some security issues).


I agree with you that it's faster and slightly more secure, but I don't
agree that the OP should stick with SSI.

PHP will give him a lot more flexibility in the future -- a lot more
chance to experiment with new things : searches, login accounts, contact
forms, etc.

mod_php's slow down over SSI is only slight, and unless he's using a
complete dinosaur of a web server, it should barely register a difference.

For what he's talking about doing, security issues don't even come into
it. It's only when you start doing things like this that security becomes
an issue:

<?php
$page = $_GET['page'];
$file = 'content/' . $page . '.php';
include($file);
?>

(and in this case there's an easy fix...

<?php
$page = $_GET['page'];
if (preg_match('/\./',$page))
{
print "SECURITY ALERT!";
exit;
}
$file = 'content/' . $page . '.php';
include($file);
?>

..)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
AF
Guest
Posts: n/a
 
      08-09-2005
On Tue, 09 Aug 2005 07:57:26 +0100, Toby Inkster
<(E-Mail Removed)> wrote:

snip
>
>PHP will give him a lot more flexibility in the future -- a lot more
>chance to experiment with new things : searches, login accounts, contact
>forms, etc.
>

snip

How very true. I have tried all kinds of ways to insert content into
html pages, and I have found php to be the best way to do this.

Can I ask the original poster, "Can you give us an example of what you
wanted to do?" If you already have posted this, I must have missed
it, but I would like to see an example of what you are trying to
insert and why?

Good luck!

Oh, by the way, I put off learning php for years. Once I started
learning it, it was very easy. Php is interesting because you can
easily and quickly learn enough to be productive with it, yet php is
complex enough it will take me a while to learn all of its usefulness.

Just don't be put off by the very complex php stuff you see; you can
quickly learn simple techniques that will help you, and then you can
grow from there.


Best regards,

Al
http://www.affordablefloridainsurance.com
http://www.americanbestmortgages.com
http://www.americanaffordablelifeinsurance.com
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      08-10-2005
> From: AF <bscinc3000@Yahoo_NoSpam.com>
>
> Oh, by the way, I put off learning php for years. Once I started
> learning it, it was very easy. Php is interesting because you can
> easily and quickly learn enough to be productive with it, yet php is
> complex enough it will take me a while to learn all of its usefulness.
>
> Just don't be put off by the very complex php stuff you see; you can
> quickly learn simple techniques that will help you, and then you can
> grow from there.
>
>
> Best regards,
>
> Al
>


You seem nice and maybe won't bite my delicate head off. Would you offer or
remind me of your path to learning this? Online refs are best but maybe a
book?

dorayme


 
Reply With Quote
 
Safalra
Guest
Posts: n/a
 
      08-10-2005
dorayme wrote:
> > From: AF <bscinc3000@Yahoo_NoSpam.com>
> > Oh, by the way, I put off learning php for years. Once I started
> > learning it, it was very easy. Php is interesting because you can
> > easily and quickly learn enough to be productive with it, yet php is
> > complex enough it will take me a while to learn all of its usefulness.
> >
> > Just don't be put off by the very complex php stuff you see; you can
> > quickly learn simple techniques that will help you, and then you can
> > grow from there.

>
> You seem nice


I'm nice too.

> and maybe won't bite my delicate head off. Would you offer or
> remind me of your path to learning this? Online refs are best but maybe a
> book?


The online PHP documentation is very good (once you go into one of the
sections the navigation appears in the left in a nice format, rather
than the huge list you get on the first page):

http://www.php.net/manual/en/

--
Safalra (Stephen Morley)
http://www.safalra.com/hypertext/

 
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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to insert a project plan and gantt chart into a Word doc? hugh jass Computer Support 3 12-29-2012 04:18 PM
cannot I search the doc's contents (doc=file.read) one more times? shaobo.li@gmail.com Ruby 0 01-11-2005 09:18 AM
String[] files = {"a.doc, b.doc"}; VERSUS String[] files = new String[] {"a.doc, b.doc"}; Matt Java 3 09-17-2004 10:28 PM
Insert data from XML doc into XHTML template knowbetter XML 1 06-28-2004 05:36 PM
Parsing MS Word client doc into server-side doc... John Wallace ASP .Net 0 07-22-2003 06:49 PM



Advertisments