variables not working with php

They have: 37 posts

Joined: Apr 2000

Please help me, i've set-up a php site which included files for the header and footer using the include command.

above this i've set-up a variable called $title and i've set this up as the page title

i.e.

code:

<?
	$title = "Features";
?>

<? include("top.php3"); ?>

<h3><? print("$title"); ?></h3>[/code]

In the included file I have the following line...

code:
<title><? print($title) ?> - The Eerie Network Millennium</title>[/code]

However the included file does not pick up the variable, but the main page does.

Any ideas??



------------------
Dan
The World of Dan 

They have: 850 posts

Joined: Jul 1999

First, remember to have <? ... ?> inside your file. Than at the start of your index page, you could just use:
<?
require("variables.txt");
?>
<html>
<title><? echo $title ?></title>
.......

That should work.

------------------
click here to help save lives
http://www.wiredstart.com : The Technology Start Page

[This message has been edited by robp (edited 17 May 2000).]

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.