View previous topic :: View next topic |
Author |
Message |
hc2995 -
Joined: 07 Aug 2006 Posts: 644 Location: Maryland, USA
|
Posted: Mon Oct 23, 2006 3:51 am Post subject: linking a php page to an HTML page |
|
|
Im new to php but i am getting better, i just today leanred hot to use the Print(); function, the mail(); function and some other stuff. My question is can i have an external .php file and link it to an HTML file?
The php file would contain things like footer and stuff like that then when i need to put the footer at the bottom i can just put:
<?
Print($footer);
?>
Which means i only need to change the footer 1 time when i change it
I have tried doing this with a <link> tag but i didnt get it working but maybe i did it wrong :/ _________________ Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P |
|
Back to top |
|
|
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Mon Oct 23, 2006 9:17 am Post subject: |
|
|
In the HTML file, put this where you want the contents of the file to appear:
Code: | <?php
include('filename.php');
?> |
_________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
|
Mikor -
Joined: 21 Aug 2006 Posts: 144 Location: Hull, England
|
Posted: Mon Oct 23, 2006 10:38 am Post subject: |
|
|
Or, if its a very important file (one that MUST be included on every page)
use this:
Code: | <?php require_once 'page.php'; ?> |
That will cause your script to die if it cannot load the page _________________ Yarrt.com - Free Arcade
RypNet.co.uk - Online Game
MSN: michael_walker_2004 <at> hotmail <dot> com |
|
Back to top |
|
|
hc2995 -
Joined: 07 Aug 2006 Posts: 644 Location: Maryland, USA
|
Posted: Mon Oct 23, 2006 12:37 pm Post subject: |
|
|
kk thnx :D _________________ Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P |
|
Back to top |
|
|
|