View Single Post
Old 04-20-2007, 03:46 AM   #1 (permalink)
markster
Code Monkey
 
markster's Avatar
 
Join Date: Jun 2006
Posts: 65
markster is on a distinguished road
Question Variables not accessable via include()

At the top of every page I incldue the design file to make edits easier. I have now started having a different page title for each page so I'm using this code:

Top of a Page:
PHP Code:
<?php
$page_title 
"Frequently Asked Questions";
include(
"http://www.stuff4web.co.uk/design.php");
?>
Top of design.php:
PHP Code:
<?php
if (isset($page_title)) {
    
$title $page_title." - Stuff4Web.co.uk";
} else {
    
$title "PHP Scripts, Java Scripts, Flash Movies and Stock Photos - All affordable at Stuff4Web";
}
require_once(
"mysql_connect.php");
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>

<title><?php echo($title); ?></title>
As you can see I have a default title in place incase I didn't specify a title for a certain page. My problem is that I always get the default title, not the one I specify, look: Click Me

What an doing wrong?

Thanks
markster is offline   Reply With Quote