Include a HTML file?

SpaceshipSpaceship
Watch

TWM

Web Marketing SpecialistEstablished Member
Impact
9
PHP includes, or requires are

<?php require("http://domain.com/file.php"); ?>

How can i include a HTML document on a HTML document... no frames.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Can you please rephrase your question? What do you want to include in what?
 
0
•••
Why do you want to include one HTML within another?
 
0
•••
in .htaccess:

Code:
AddType application/x-httpd-php-source .htm .html
Add that code,
Then you can use php in your html documents.
 
0
•••
axilant said:
in .htaccess:

Code:
AddType application/x-httpd-php-source .htm .html
Add that code,
Then you can use php in your html documents.

thats not a partcularly effcient method. Its is better to save all the files with php in them using the .php extension
 
0
•••
I guess you could say i wanted something like this:

<?HTML include("http://domain.com/file.htm"); ?>

obiously thats not correct, but you get the point.

Anyone know? I'd prefer not to use the .htaccess method
 
0
•••
But this person wants to use it in html ;) So this is the easiest way... unless of course they wanted to use ssi ;) Although, i think HTML should make a way to include files... it would make life a hell of a lot easier for web masters! (and programmers!)

idevisedesign said:
I guess you could say i wanted something like this:

<?HTML include("http://domain.com/file.htm"); ?>

obiously thats not correct, but you get the point.

Anyone know? I'd prefer not to use the .htaccess method

Posted at the same minute ;)
 
0
•••
idevisedesign said:
I guess you could say i wanted something like this:

<?HTML include("http://domain.com/file.htm"); ?>

obiously thats not correct, but you get the point.

Anyone know? I'd prefer not to use the .htaccess method
you cannot do that. HTML is a layout language, not a parsing code.
 
1
•••
ahh I see.. you want to include an html file just like a php file.. I dunno any code sorry.
but I know what you mean :)
 
0
•••
you can call .txt files with php, i dont think it works with .html though
 
0
•••
Theres really no way to do what you want... your going to need to us a .shtm, .shtml, .php or something file if you want to include... unless you use add type... :-/
 
0
•••
what is shtml?
 
0
•••
Secure HTML.

Secure HyperText Markup Language.

Much like HTML but stricter in terms of tags that are allowed to be used.
 
0
•••
oh, ok thanks! :)
 
0
•••
idevisedesign said:
I guess you could say i wanted something like this:

<?HTML include("http://domain.com/file.htm"); ?>

obiously thats not correct, but you get the point.

Anyone know? I'd prefer not to use the .htaccess method

In your *.php file, write the following line where you want to output your html file.
Code:
<? echo file_get_contents ('http://domain.com/file.htm'); ?>

Can't currently test that, but I think it should work..

PM me if you have some questions ;)
 
0
•••
dgaussin,

Its an HTML file
 
0
•••
Sorry I wasn't sure about that. So like Axilant said, the only way to do that is to add one line in htaccess to allow Apache to parse the html file like php.
 
0
•••
Secure HTML.

Secure HyperText Markup Language.

Much like HTML but stricter in terms of tags that are allowed to be used.

Sorry, that's incorrect.
SHTML is an acronym for server-parsed HTML. SHTML is a valid extension for a web document - you can utilize SHTML if it is active on your server and your documents have the .shtml extension. Server parsed HTML is often used for file includes. SHTML is parsed on the server before being sent to the user making the page request.
 
0
•••
Appraise.net

We're social

Spaceship
Domain Recover
CatchDoms
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back