[TYPO3-dev] My first (for me) advanced extension
Andreas Förthner
Andreas.Foerthner at netlogix.de
Fri Mar 17 14:39:08 CET 2006
Brian Bendtsen schrieb:
> Mads Brunn wrote:
>
>> > - Do I place this function in the class_myextension_pi1.php file or
>> > do I have to create another?
>>
>>
>> You don't have to put it in class.myextension_pi1.php but that would
>> be the most obvious thing to do (not sure I understand this question).
>
>
> Thank you, that was very helpfull.
>
> About that question. I have my form now and Im not sure what to put in
> the action attribute. Im pretty sure that I just call
> class_myextension_pi1.php, but what parameters is needed to tell the
> script to go to the function that will write something to my database
> table.
>
> /Brian Bendtsen
Hi,
you should use the link functions of the TYPO3 Api. Just let the url
generate by one of the url functions and send your additional data (the
form fields) via post vars, with get params this won't work, because you
might have already an url with get-params in your action attribute.
Wich functions are availabel and which to use is nicely explained in an
article by Robert Lemke, just look in the articles section on typo3.org.
To tell your script that the form has been submitted and it sould do the
insert, you could pass an parameter with an hidden field like that:
<input type="hidden" name="action" value="insert" />
Then you just have to check if the parameter action is present and if
it's value is insert. If that is true you can call the insert function...
Hope this helps,
Regards
Andreas
More information about the TYPO3-dev
mailing list