Hi all -
Seems I have an interesting delimma here.
I have an HTML/PHP report that I pass to a script called print.php via a variable called $uri in order to create a "printer friendly" version of the report. Basically the print.php script constructs the original report location from $uri, opens and searches the report document for <!--BEGIN--> and <!--END--> comment tags using filesystem functions, "strips" the content between the tags (both PHP and HTML), and displays the resulting report.
The need has now arisen to hide some icons and links that should only be viewable in the full report version but not in the print friendly report, but because of the way the report is structured must be within the content tags. I tried to accomplish this using a global variable called $printfriendly, but couldn't make it work, I assume because of the way the filesystem functions work -- $printfriendly would be TRUE in the print.php script, but would either be false or not exist in the content section from the original report. I also tried to use $PHP_SELF, $REQUEST_URI, and similar constants, but again couldn't make it work because once my print.php script "jumps" into the original script, those variables change to reflect info about that file.
All of this is going on in a CMS environment that won't allow me to use sessions or templates since the CMS itself is built in PHP.
Anyone have any ideas how I can accomplish this? Am I missing something about how global variables work? Is there some trick or magic that I can perform?
Thanks for your help,
-- phil --