|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I want to create an include file which i want to call from various html files..i tried doing this but it does not work at all.pls suggest how do i go about it..
Thanks Yashika Include.html:- This is the file i want to call from various files: <table width=100%> <tr><font color="red"> Chat with fellow fans while watching Jimmy and Lucas share their opinions about the Royal Rumble on Gettin' RAW. If you haven't registered, please register now. To maximize this experience, make sure you have the correct media player.</font> </tr></table> main.html: from this file the include file is been called: <html> <head> <title>main</title> </head> <body> <!-- #INCLUDE file = "include.html" --> </body> </html> ------------------ |
|
#2
|
|||
|
|||
|
--- begin main.htm --- (cut here) ---
<html> <head> <title>Example</title> </head> <body> <center> Hello from HTML<br> <script language="javascript" src="include.js"></script> <noscript>(javascript required)</noscript> </center> </body> </html> --- end main.htm --- (cut here) --- --- begin include.js --- (cut here) --- document.write( 'Hello from Javascript' ); --- end include.js --- (cut here) --- |
|
#3
|
|||
|
|||
|
Well, does your server parse SSI commands for .html files? For security reasons, most servers require your page to be named as main.shtml instead of main.html in order to execute SSI commands.
If it still doesn't work, try using all lowercaps ... I'm not too sure if the command is case-sensitve ![]() <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> <!--#include file="include.html" --> [/code] |
|
#4
|
|||
|
|||
|
while we're on the subject of include files...
i'm pretty new at this, and i'm trying to create a template that can display all html or asp content. like this: (template.xxx) ...<body>... <?php readfile($file); ?> ...</body> it's called like this: template.xxx?file=... only, instead of php3 it must be asp code, or html. does anyone know how to do this? please mail me a copy of your answer at nout@p4p.nl. thanks. |
|
#5
|
|||
|
|||
|
Vernon,
The example you posted works only for script code. It does not work for HTML code like displaying a table or an image. Any other ideas? <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Vernon Frazee: --- begin main.htm --- (cut here) --- <html> *<head> * <title>Example</title> *</head> *<body> * <center> * *Hello from HTML<br> * *<script language="javascript" src="include.js"></script> * *<noscript>(javascript required)</noscript> * </center> *</body> </html> --- end main.htm --- (cut here) --- --- begin include.js --- (cut here) --- document.write( 'Hello from Javascript' ); --- end include.js --- (cut here) ---[/quote] |
|
#6
|
|||
|
|||
|
actually the js file should work if you have something like this in it (addme.js):<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
document.write('<table width=100%>'); document.write('<tr><td><font color=red>'); document.write('Chat with fellow fans...'); document.write('</font></td></tr></table>'); [/code] And in your main.html:<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> <html> <head> <title>main</title> </head> <body> <script language="JavaScript" src="addme.js"></script> </body> </html> [/code] Hope that helped. [This message has been edited by stardotstar (edited November 14, 2000).] |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > include file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|