"Chris W. Parker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
PHP Webmaster <mailto:[EMAIL PROTECTED]>
    on Monday, October 20, 2003 4:36 PM said:

> As you can see, the above code will not work as the $title variable
> has not been set yet. So, I need a way of opening up the home.php
> file, extracting the line containing the $title variable and putting
> that information inbetween the <title></title> tags.

In that case do it backwards:


index.php:

<?php

$title = "page title";


include "header.php";

echo "<p>Welcome to the home page of our website.</p>\n"
."<p>Blah, blah and more blah!</p>\n";

include "footer.php";


?>

header.php:

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


footer.php:

</body>
</html>


Hope this helps!!


Chris.

--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

The above would work OK, but in the index.php file, where I have:

<?php
require("home.php");
?>

The required file will be changing all the time, that's why I want to set
the title in the individual pages and get the main page to read that
information.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to