Web Hosting Talk







View Full Version : PHP Includes?


Discovery06
08-04-2005, 10:16 AM
What is the code I need to use if I want to include a page on my site on another page?

I thought the code was

<?php include = ("path/to/file.extension") ?>

but I'm getting parseing errors, so my code is obviously wrong

How should the code be written?

GerhardB
08-04-2005, 06:02 PM
it should read <?php include("path/to/file.extension"); ?>

the ; in the end is very important and no '=' letter :)

ub3r
08-04-2005, 06:22 PM
you can also do

<?
$include = include('/path/to/file.extension');
?>

but that seems very redundant.

SupaDucta
08-05-2005, 09:13 PM
Originally posted by Discovery06
What is the code I need to use if I want to include a page on my site on another page?

I thought the code was

<?php include = ("path/to/file.extension") ?>

but I'm getting parseing errors, so my code is obviously wrong

How should the code be written?


If you will be doing anything with PHP, have the manual handy:

http://www.php.net/manual/en/function.include.php