Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing Scrit Variable

Status
Not open for further replies.

4x4uk

Technical User
Apr 30, 2002
381
0
0
GB
I now seem to have a problem with some of my code since PHP has been upgraded to Version 4.3.10. For some reason the page title no longer appears to exist
My current website uses include to write the HTML tags for the start of every page on the site, as shown below.
header.inc
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<?php 
include ("metadata.inc");
include ("dirinfo.php");
include("ipblock.php");
?>
<title><? echo  $title;?></title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="StyleSheet" href="Common/master.css" type="text/css" media="screen">

This is then called in every page as shown below
Code:
<?php
$title="NE4x4 - About the Club";
include('Common/header.inc');
?>

Anyone got any ideas

Infinity exists! - I just haven't worked out a way to get there yet.

 
With the upgrade it may be that global variables are now off (as this is the default)

Try this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<?php
include ("metadata.inc");
include ("dirinfo.php");
include("ipblock.php");
?>
<title><? echo  [COLOR=red]$_GET['title'];[/color]?></title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="StyleSheet" href="Common/master.css" type="text/css" media="screen">

- Web design and ranting
- Day of Defeat gaming community
"I'm making time
 
That has nothing to do with what OP is doing.

Try simplifying the problem to see what's going on:
Code:
<?php
$title="NE4x4 - About the Club";
include('Common/header_test.inc');
?>
as before. In header_test.inc
Code:
<?php
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">',"\n";
echo '<html><head>',"\n";
echo '<title>' . $title . '</title>',"\n";
?>
and see if that produces the correct code. If it does, check your other includes to see if they are causing the problem. Perhaps there is a coding error in one of them.

Take a look at the generated source.

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top