Hello all, hope all is well in your location. I received some great advice here regarding using functions to call in my style sheet/java script info based on the php page that was requested by the user. I have a related question that is eluding me. I have a header_functions.php file that is in a require statement of a file called test3.php. test3.php is a test page, obviously, that I am using to proof a concept. I am trying to call a function in header_functions.php that has a switch statement that evaluates a passed value which is the name of the page calling the function. When I do this I get no results. This usually means I have done something wrong. If anyone has any suggestions, please help... Here's my code...
*****begin header_functions.php*******
<?php
function header_javastyles($refer_page) {
switch ($refer_page) {
case "test3.php":
$ jimmi = "\n<STYLE TYPE=\"text/css\">\n".
"<!--\n".
"BODY, TH, TD, OL, UL, LI { font-family: verdana, arial, helvetica, sans-serif; font-size: x-small; }\n".
"H1 { font-size: 175%; font-family: verdana, arial, helvetica, sans-serif; }\n".
"H2 { font-size: 150%; font-family: verdana, arial, helvetica, sans-serif; }\n".
"H3 { font-size: 125%; font-family: verdana, arial, helvetica, sans-serif; }\n".
"H4 { font-size: 100%; font-family: verdana, arial, helvetica, sans-serif; }\n".
"H5 { font-size: 75%; font-family: verdana, arial, helvetica, sans-serif; }\n".
"-->\n".
"</STYLE>\n";
break;
}
return $jimmi;
}
?>
****end header_functions.php*****
**begin test3.php***************
<?php
global $jimmi;
global $referrer;
$referrer = $PHP_SELF;
include ("/u01/httpd/html/flywindsock/forum/include/header_top.php");
require ("/u01/httpd/html/flywindsock/forum/include/header_functions.php");
$referrer = StripSlashes($referrer);
header_javastyles($referrer);
echo($jimmi);
include ("/u01/httpd/html/flywindsock/forum/include/header_bottom.php");
?>
<P> Hello Jimmi</P>
<?php
include ("/u01/httpd/html/flywindsock/forum/include/footer.php");
?>
*end test3.php**********************
Thanks in advance for your wisdom and sorry about posting this initially in the general help forum.
JimmiZ