[Typo3] Embedding php scripts

Lucas Birk tlist at birkit.com
Mon Nov 28 17:21:28 CET 2005


This is what I did to include a script on a page.
It is called by using the text element and inserting the tag 
<myform>whatever, here i, want, to, pass</myform>
Just a guess: Perhaps you need to setup your script as in 
my_script_setup.inc?
#Constants
scriptB = my_script_setup.inc
scriptC =  name_off_my_script.inc
scriptPath = fileadmin/main/template_files/scripts/
#Setup
#include a php script with a tag call
tt_content.text.20.parseFunc.tags {
       myform.stripNL = 0
       myform = PHP_SCRIPT
       myform.file = {$scriptPath}{$scriptB}
}
includeLibs.testclass_example = {$scriptPath}{$scriptC}
<?
#my_script_setup.inc
#Call the file name_off_my_script.inc
$test_object = new NameOfMyClass;
$contentOfTag = $this->getCurrentVal();
$content = $test_object->sendmail($contentOfTag, 1);
?>
<?php
#name_off_my_script.inc
class NameOfMyClass
{
$GLOBALS["TSFE"]->set_no_cache();
$page_id = htmlspecialchars(stripslashes($_REQUEST['id']));
}
Hope that helps!
Lucas



More information about the TYPO3-english mailing list