Seite 1 von 1

ACP - Formular-Daten in Tabelle speichern

Verfasst: 26.10.2010 15:15
von iTobias
Hi,

Ich habe ein neues Modul im ACP angelegt, indem ich ein Formular erstellt habe. Wie kann ich die Daten, welche durch das Formular eingegeben wurden in die Datenbank (Tabelle phpbb_tm_meinmod) speichern?

Muss ich jede Formulareingabe in eine Variable einlesen und dann in der DB anspeichern?

acp_tm_imprint.php

Code: Alles auswählen

<?php

/**
*
* @package acp
* @version $Id: acp_tm_imprint 2010-11-26 19:45:45Z _Raja_ $
* @copyright (c) 2010 Tobias Millauer
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @package acp
*/
class acp_tm_imprint
{
    var $u_action;

    function main($id, $mode)
    {
        global $db, $user, $auth, $template;
        global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;

        $user->add_lang('mods/tm_imprint_acp_lang');
        $this->tpl_name  = 'acp_tm_imprint';
        $this->page_title    = $user->lang['ACP_TM_IMPRINT'];
        add_form_key('tm_imprint');

        $submit = (isset($_POST['submit'])) ? true : false;
        if ($submit)
        {
            if (!check_form_key('acp_tm_imprint'))
            {
                 trigger_error($user->lang['TM_IMP_ACP_FORM_INVALID']);
            }

            // Formular-Daten in DB abspeichern

            trigger_error($user->lang['TM_IMP_ACP_SAVED'] . adm_back_link($this->u_action));
        }
    }
}

?>

Re: ACP - Formular-Daten in Tabelle speichern

Verfasst: 26.10.2010 17:36
von Dr.Death
Hallo,

Ja ! Du hast Deine Frage bereits selbst beantwortet ;-)

Re: ACP - Formular-Daten in Tabelle speichern

Verfasst: 26.10.2010 18:04
von iTobias
Danke für deine Antwort, aber ich hab eigentlich gehofft, dass sie anders ausfällt :grin: