Re: Include Problems
| From: | sven | Date: | Fri, 25 Jul 2003 09:24:11 +0000 |
| Subject: | Re: Include Problems | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-156812@lists.php.net to get a copy of this message | ||
hi eric,
as far as i can see, there is no definition for your '$subnav' in your
'incHeader.php'.
if you call your main script like this:
'http://example.com/index.php?subnav="home"',
this should work with your
inclusion.
ciao SVEN
Eric Fleming wrote:
> Here is a snippet from the header file. You can see that I am just
> trying to determine what the value of the subnav variable is set to
> in order to determine which navigational link is bold. There are
> other places the variable is used, but you can get an idea based on
> what is below. Thanks for any help.
>
> <-----incHeader.php------>
>
> <html>
> <head>
> <title>[Site Name]</title>
> </head>
> <body>
> <table cellpadding="0" cellspacing="0" border="0"
> align="left">
> <tr>
> <td>
> <? if($subnav == "home"){ ?><b><? }?><a
> href="index.php">home</a><? if($subnav == "home"){
> ?><b><? }?>
> </td>
> </tr>
> </table>
>
> <-----incHeader.php------>
>
>
> "Jennifer Goodie" <goodie@apollointeractive.com> wrote in message
>
> news:NEBBIJJIKBGCCCNKMPBCOECOIIAA.goodie@apollointeractive.com...
>> Without seeing what you have in your includes, it will be hard to
>> determine where your scope is messed up.
>>
>>> <?php
>>> $subnav = "home";
>>> include("incHeader.php");
>>>>
>>>
>>> <!--- CONTENT AREA --->
>>>
>>> The content would go here.
>>>
>>> <!--- END CONTENT AREA --->
>>>
>>> <?php include ("incFooter.php"); ?>
>>>
>>> Now, when I try to reference the subnav variable in the
>>> inHeader.php or incFooter.php files, it comes up blank. I am
>>> basically trying to adjust the
>>> navigation on each page depending on the page I am on. I am just
>>> learning PHP, have programmed in ColdFusion for years and in
>>> ColdFusion
>>> this was not
>>> a problem. Any ideas?