Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include file

Status
Not open for further replies.

alsaffar

Programmer
Oct 25, 2001
165
KW
Hi Guys,

I want to know how can I include a file to my html pages cause there is a poece of code I have to put it in every single page and it might be modified from time to time, so I don't want to modify every single page, I want only to modify the file that I want to include it in all my pages.
 
If you can use PHP, do:
<? include(&quot;file.html&quot;); ?>

If it is a javascript file, do this:

<script src=&quot;file.js&quot;></script>

for an html file without server side including:

<iframe src=&quot;file.html&quot; frameborder=&quot;0&quot; border=&quot;0&quot;></iframe>

for if(($question==&quot;has been bugging me&quot;
AND $answer==&quot;fixed the problem&quot;) OR $answer==&quot;really good post&quot;){
print(&quot;Star&quot;);
}else{
print(&quot;Thanks.&quot;);
}
 
<!--# include file=&quot;file&quot; -->
but if you're are adding javascript code just
<script language=&quot;javascript&quot; src=&quot;script.js&quot;></script>
rememebr to take out the <script> tags in the .js file hope I helped!
[roll2]
admin@onpntwebdesigns.com
 
If you can use php:

<? include(&quot;file.html&quot;); ?>

for a javascript file:

<script src=&quot;file.js&quot;></script>

for an html file:

<iframe src=&quot;file.html&quot; border=&quot;0&quot; frameborder=&quot;0&quot;></iframe>

Rick if(($question==&quot;has been bugging me&quot;
AND $answer==&quot;fixed the problem&quot;) OR $answer==&quot;really good post&quot;){
print(&quot;Star&quot;);
}else{
print(&quot;Thanks.&quot;);
}
 
If you can use php:

<? include(&quot;file.html&quot;); ?>

for a javascript file:

<script src=&quot;file.js&quot;></script>

for an html file:

<iframe src=&quot;file.html&quot; border=&quot;0&quot; frameborder=&quot;0&quot; style=&quot;width:250px;height:300px;&quot;></iframe>

Rick if(($question==&quot;has been bugging me&quot;
AND $answer==&quot;fixed the problem&quot;) OR $answer==&quot;really good post&quot;){
print(&quot;Star&quot;);
}else{
print(&quot;Thanks.&quot;);
}
 
wow! I can never tell if my post went through till after I've posted it again!

Rick if(($question==&quot;has been bugging me&quot;
AND $answer==&quot;fixed the problem&quot;) OR $answer==&quot;really good post&quot;){
print(&quot;Star&quot;);
}else{
print(&quot;Thanks.&quot;);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top