Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

including php in templates

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
rzw
Smarty n00b


Joined: 28 Jun 2003
Posts: 1

PostPosted: Sat Jun 28, 2003 9:37 am    Post subject: including php in templates Reply with quote

I'm absolutely no pro. To facilitate the maintenance of my site I thought I'd give Smarty a try. All works fine with the HTML parts. But I couldn't find examples to help me include the following PHP code from my pre-Smarty Welcomepage.

<?PHP
function feedback($subj,$body){
mail("log@hi-response.com",$subj,$body);
}

$wann = strftime("%Y-%m-%d %R");
$wer = $REMOTE_ADDR;
$aufruf = $REQUEST_URI;
$anfrage = $QUERY_STRING;
$mail1 = $wann;
$mail1 .= " § ";
$mail1 .= $anfrage;
$arr_body= array($wann, $aufruf, $anfrage, $HTTP_USER_AGENT, $wer,gethostbyaddr($wer));
$mail2 = join(chr(13), $arr_body);

feedback($mail1, $mail2);
?>

neither could I get my statistics PHP-module to work:
================================

<?
DEFINE ("_BBC_PAGE_NAME","index.php");
DEFINE ("_BBCLONE_DIR", "bbclone/");
DEFINE ("_NEW_COUNTER", _BBCLONE_DIR . "mark_page.php");

if(file_exists(_NEW_COUNTER))
{
include (_NEW_COUNTER);
}
?>

The answer will probably be trivial enough to embarass me. But I've gone this far. I want to finish the job (in a reasonable amount of time)

Thanks, Rudy
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Jul 02, 2003 6:25 pm    Post subject: Reply with quote

Hi Rudy. I'm scratching my head trying to figure out where and when you want to integrate that into your Smarty templates and/or app structure.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP