Forum Moderators: coopster

Message Too Old, No Replies

including html in php

prize included

         

digitaleyecop

1:29 pm on Jul 26, 2005 (gmt 0)

10+ Year Member



does anyone know the full code in which where you include a html page in your php page

e.g

index.php?id=main --->>> came from ---->> main.html

i think it was

<?php require("id$html");?> but it doesnt work

PLEASE can someone help me

and if it works i will personally thank them

jackvull

2:10 pm on Jul 26, 2005 (gmt 0)

10+ Year Member



Not sure I fully understand what you're trying to get at but do you mean:
<?php include("menu.html");?>

where menu would be replaced by the name of your html page

?

digitaleyecop

2:14 pm on Jul 26, 2005 (gmt 0)

10+ Year Member



no

i mean using 1 code

E.G
<?php include("id$html");?>

it can show lots of pages

by
id=main
id=2
id=blah

Mr_Fern

7:44 pm on Jul 26, 2005 (gmt 0)

10+ Year Member



"$id.html" instead of "id$html"

siduk

3:36 pm on Jul 27, 2005 (gmt 0)



$id = $_GET['id'];

include('$id.html');

if your url looks like getpage.php?id=main it will then show your page as main.html

coopster

2:01 am on Aug 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, siduk.

Actually, you would need to have that in double quotes in order to get it to parse correctly.

opiston

6:18 am on Aug 3, 2005 (gmt 0)

10+ Year Member



Hi digitaleyecop,
This is what I did with my page.


if($page) {
include "$page";
}
else {
$page = "blank.html";
include "$page";
}

hope this helps

Opiston