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));
}
}
}
?>