[thelist] File Include Tip

Burhan Khalid burhankhalid at members.evolt.org
Mon May 6 16:55:00 CDT 2002

Hello Folks :

	Thought I'd share an alternate way to include a file (using PHP), that
doesn't use SSI's.

<tip type="PHP File Include" author="Burhan Khalid">

	Want to include a file in your page? Use this :

	function getContent ($fileName, &$body) {
		$body .= fread (fopen($fileName,"r"), filesize ($fileName));

	call it like this :

	getContent("include.txt", $body);

	now simply place <?= $body; ?> where you need the content to go.

Simple, but I thought someone could use it somewhere.
Burhan Khalid

More information about the thelist mailing list