PDA

View Full Version : PHP in templates?


djohn
04-10-2004, 06:11 PM
How can i add a php line in one of my templates? I need to include() a script, but all my attempts were unsuccessfull :(

Zachery
04-10-2004, 06:23 PM
you cant do stright php in templates

you can only use php in 2 templates

phpinclude_start and end

djohn
04-10-2004, 06:49 PM
Any way to use these templates to include() my script in the template called, for example, "scripttemplate" ?

Zachery
04-10-2004, 06:50 PM
$var = include(file.php);

put var into your template

weezer412
04-10-2004, 07:19 PM
$var = include(file.php);


put var into your template

are you sure you dont use implode?

Zachery
04-10-2004, 07:21 PM
i dont know php at all :) :D

weezer412
04-10-2004, 07:23 PM
see i did this

$fav = "include('./favs/')";
$fav

in my postbit template and it shows up as this

= "include('./favs/')";

Zachery
04-10-2004, 07:31 PM
see i did this

$fav = "include('./favs/')";
$fav

in my postbit template and it shows up as this

= "include('./favs/')";
dont think you need the quotes

weezer412
04-10-2004, 07:33 PM
dont think you need the quotes

i tried both but when i wanted to include something in my footer i did this


$advertise = implode ('', file ('http://www.thecerealkiller.com/ad.php'));

and where do i find all the spots where variable are listed...

NTLDR
04-10-2004, 08:29 PM
There is an example of howto include PHP files in the default phpinclude_start template.

SVTBlackLight01
04-10-2004, 10:44 PM
There is an example of howto include PHP files in the default phpinclude_start template.

I tried using the example in the default phpinclude_start template and continued to get errors with my php file, but the implode method works. Is there anything wrong with using this method?