You are here: Very newbie question (including other php files) « PHP SQL « IT news, forums, messages
Very newbie question (including other php files)

Posted by Dan on 11/10/05 12:51

If I've got one file called header.php that contains the following code ...

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


and I've got index.php that contains the following code ...

<?php $title_string = "My Title String"; ?>
<?php include "header.php"; ?>
Main body contents<br>
</html>

Why is the $title_string variable empty (or undefined) in header.php? Basically, my actual header.php is a lot bigger, and I want
all my webpages to include this header, but specifying different options - ie. the title string, and a few others.

Cheers for any help,
Dan.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация