Re: PHP Question regarding include()

From: Date: Wed, 29 Nov 2000 11:32:55 +0000
Subject: Re: PHP Question regarding include()
Groups: php.general 
Request: Send a blank email to php-general+get-27803@lists.php.net to get a copy of this message
>I current have: > include("header.php?headertitle=homepage&headersection=home"); >in index.php. This is so each content page can set the title and 'section' >for the header of each page. > >and in header.php > <title>Daniel's Website:<? $headertitle ?></title> Your method doesn't work (as you found out). Someone else on the list can probably elaborate as to why. The contents of any included file are treated as if they were present in the including document itself. Therefore, you can simply assign values to the variables and then include the remote file: $headertitle = 'homepage'; $headersection = 'home'; include( 'header.php' );

« previous php.general (#27803) next »