PDA

View Full Version : PHP Page Includes


JeffLareaux
06-27-2004, 01:19 PM
Hi,
I only need to know the code on how to do page includes. Sorry to bother you guys, I am trying to figure this out for a week now and yet I'm still stuck. I would really appreciate this to save time.

I am using DirectAdmin CP and I don't know what I am doing wrong.

<?php

include ('mypage.html');

?>

Thank you very much for your time.

ctnchris
06-27-2004, 04:49 PM
I dont see why that doesnt work, but try this:

<?
$file = "mypage.html";
if (file_exists($file)) {
@include($file);
} else {
echo "<b>Error</b>: unable to open $file. Please check that it exists and is readable.";
}
?>