---
title: "TEMPLATE with PHP code"
url: "https://www.typo3.net/d/9409-template-with-php-code"
source: "typo3.net"
tags: ["Allgemein","English","Frage"]
created: "2004-02-26"
last_reply: "2004-03-11"
replies: 2
solved: false
page: 1
pages: 1
lang: "en"
---

# TEMPLATE with PHP code

Allgemein · 2 Antworten · gestartet 2004-02-26

## Eröffnungsbeitrag

**vanea** · 2004-02-26 · [Beitrag #1](https://www.typo3.net/d/9409-template-with-php-code/1)

I have this template....in indx.html file
My site is based on this one....

MENU is for left menu, which is created from page structure
CONTENT is content of pages when a menu is clicked

instead of MYPHP I want the content returned by ECHO from my own php script which is in inc/myscript.php

HOW TO DO THAT ?

file /inc/myscript.php
----------------------
<?
   echo "hello from myscript.php";
?>
---------------------

file index.html (template)
-------------------------

<HTML><HEAD><TITLE>Welcome</TITLE>
<BODY>
<!--###DOCUMENT_BODY###  start-->

<TABLE>
<TR>
    <TD>
	    <!--###MENU###  start-->
	    <!--###MENU###  stop-->
    </TD>

    <TD>
	    <!--###CONTENT###  start-->
	    <!--###CONTENT###  stop-->
    </TD>
</TR>
</TABLE>

<!--###MYPHP###  start-->
<!--###MYPHP###  stop-->

<!--###DOCUMENT_BODY###  stop-->

</BODY>
</HTML>

----------------------------

## Antworten

### [#2](https://www.typo3.net/d/9409-template-with-php-code/2) · TW · 2004-02-26

hi
just trie this........

put this into your setup code field...

tt_content.script = CASE
tt_content.script {
key.field = select_key
test = PHP_SCRIPT_EXT
test.file = fileadmin/mysrcipt.php
}

and now make an new side content
change field Typ=Text to
TYP=Script

and write in the CODE field
mysrcipt

and you get it!

btw: delete the markers in your html template

```html
<!--###MYPHP### start--> 
<!--###MYPHP### stop-->
```

you don't need them..

cu
thorsten

### [#3](https://www.typo3.net/d/9409-template-with-php-code/3) · c4c · 2004-03-11

> **TW schrieb:**
>
> test = PHP_SCRIPT_EXT
> test.file = fileadmin/mysrcipt.php
>
> ..
> ..
> ..
>
> and write in the CODE field
>
> **mysrcipt** <-  .. isn't it "test" in this case?
>
> grEEz
> stEvo

[/b]

---

Quelle: „TEMPLATE with PHP code“, typo3.net, https://www.typo3.net/d/9409-template-with-php-code
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
