PDA

View Full Version : How do I put PHP in the Styles header?


Vigile
Wed 4th Apr '01, 2:14am
I want to put the following code into my header in the style template:
<? $dotBanner_file_directory = "/home/amdmb/www/dot/";
include("$dotBanner_file_directory" . "Top_468.php"); ?>

With useadvheader off, it just prints that line.

With useadvheader on, i Get an eval'd() error?

What do I need to do?

Mike Sullivan
Wed 4th Apr '01, 2:35am
Try taking out the <? and ?>

Vigile
Wed 4th Apr '01, 2:42am
Just tried it without them.

I get this error with the PHP option on:

Parse error: parse error in global.php(793) : eval()'d code on line 1

And again it just prints out the code with the option off.

Does it make a difference if I tell you this is banner code, and that it makes a couple database calls?

Mike Sullivan
Wed 4th Apr '01, 2:49am
The easiest thing would be to just stick the code directly in global.php.

Vigile
Wed 4th Apr '01, 2:58am
Do you mean save the output as a variable? Like

include ("needed ad files");
$adstuff = ad_get_funct("Top_468");

then just echo $adstuff?

Mike Sullivan
Wed 4th Apr '01, 3:07am
Yeah. That's what you would've had to do anyway.