Hi. I apologize for asking such a thorny question on my very first post to this forum. If anyone can help me, though, I would be very grateful. I hope my description makes sense.
On my pages I load a set of navigation tabs with an include file. Which tab is "on" depends on how a variable is set right before the "include" call.
So the code in the main document is something like this:
$TabOn = 1; // where, say, 0 =Home; 1= Articles; 2 = ...
include("tabbar.inc");
Inside the tabbar.inc file, I have code like this for each tab:
[i] <td><a href="http://www.mysite.com/"><img src="images/nav/articles_<?php if($TabOn==1){echo "on";} else {echo"off";} ?>.gif" height="29" width="108" border="0"></a></td>
[/i]
This used to have the effect that if the tab (in this case the "articles" tab) was supposed to be "on", it would load one tab image. Otherwise it would load another tab image.
What must have allowed this to work was that the include file was dumped into the main file BEFORE the PHP was interpreted. This allowed the variable assigned in the main document to have a value when the code in the include file was interpreted.
NOW, however, it seems that the PHP in the include file is interpreted first, and then the file is included in the document, so that the variable always has a value of zero (Home), regardless of what value it is assigned in the main document.
QUESTION: Is this something that changed with the latest version of PHP? And is there an easy way to fix the problem without having to change the code on every page? I.e., is there a .htaccess command that would help or something?
Thank you in advance for your help.
Larry