Page 1 of 1

executing php used in file_get_contents

Posted: Wed Oct 19, 2005 5:39 am
by mickd
hi, as an example i have these 2 pages

test1.php

Code: Select all

<?php
$title = 'THIS BETTER WORK!';
?>

<html>
<head>
<title><?php echo $title; ?></title>
</head>

<body>
</body>
</html>
and

test.php

Code: Select all

<?php

echo (file_get_contents('test1.php');

?>
the problem is probably obvious but just incase, how do you get it so that in the test.php itll display it as if it was test1.php.

thanks for any help.

Posted: Wed Oct 19, 2005 6:50 am
by feyd
include()

file_get_contents() simply reads the file as is, nothing more.