PDA

View Full Version : Code for including a page?



PinkFM
14-12-2006, 10:32 PM
Say I wanted to include some php on a html page and I have the php code on a different page how do I add like an include to that page using html?

Such as <include="blah.php">

Please help, plus rep

Blinger1
14-12-2006, 10:43 PM
php only works on php pages... so pages like "test.php" not "test.html" ;)

Lysine
14-12-2006, 10:44 PM
<?php include("PAGENAME.php"); ?>

PinkFM
14-12-2006, 10:56 PM
is there a HTML version of that code at all?

Blinger1
14-12-2006, 11:01 PM
try this:

<!--#include FILE="b.inc" -->

PinkFM
14-12-2006, 11:10 PM
try this:

<!--#include FILE="b.inc" -->

That works thanks!
I needed it to make my website load faster and that works!
Rep given out soon, thanks for helping people.

Blinger1
14-12-2006, 11:17 PM
:) no problem, i advise to use google next time ;)

PinkFM
14-12-2006, 11:46 PM
I did, but I didn't really know what I was looking for so I couldn't find it. SO I thought here was the next best thing to help me :D

Blinger1
15-12-2006, 12:24 AM
http://www.google.com.au/search?hl=en&q=how+to+include+a+html+file&btnG=Google+Search&meta=

...

ScottDiamond
15-12-2006, 05:08 PM
You could do an iFrame:



<iframe name="iframe" src="page.html" width="WIDTH HERE" height="HEIGHT HERE" frameborder="0" scrolling="yes">Text here for browsers that can't see iFrames.</iframe>

Or you can use PHP and put:


<?php
include("page.php")
?>

Or, as said above:


<!--#include FILE="b.inc" -->

CJ-real
16-12-2006, 08:57 PM
That works thanks!
I needed it to make my website load faster and that works!
Rep given out soon, thanks for helping people.

Yeah... use .shtml extension

ScottDiamond
17-12-2006, 02:35 PM
Lol at the dude who minus repped me for this reason:

"You were not very helpful and just copied the other code!"

Erm... the iFrame was mine? ;l

Edited by Reformed (Forum Moderator) - Please stay on topic, Thanks :).

Want to hide these adverts? Register an account for free!