Userangaben in DB übernehmen
Verfasst: 06.08.2005 21:32
Hi Leutz !
Ich habe mir den Shop-Mod ein wenig umgeschrieben. Wenn jetzt jemand etwas kauft, benötige ich die Adresse des Users, und habe mir nun eine shop_angaben.tpl und eine shopangaben.php programmiert, doch leider bekommt er die Variable nicht aus der tpl und ich weiss echt nicht, warum bitte helft mir ! (Der code versucht z.Z. nur die PLZ in die DB einzutragen. Die Felder sind natürlich in der DB enthalten)
Hier die TPL:
und hier die php
THX schonmal im vorraus !
www.aprilia-racing-forum.de
Ich habe mir den Shop-Mod ein wenig umgeschrieben. Wenn jetzt jemand etwas kauft, benötige ich die Adresse des Users, und habe mir nun eine shop_angaben.tpl und eine shopangaben.php programmiert, doch leider bekommt er die Variable nicht aus der tpl und ich weiss echt nicht, warum bitte helft mir ! (Der code versucht z.Z. nur die PLZ in die DB einzutragen. Die Felder sind natürlich in der DB enthalten)
Hier die TPL:
Code: Alles auswählen
<form action="{S_ANGABEN_ACTION}" method="post">
<table width="56%" border="0" align="center" cellpadding="10" cellspacing="0">
<tr>
<td><table width="83%" border="0" align="center" cellpadding="4" cellspacing="1" class="forumline">
<tr>
<th height="25" colspan="2" class="thHead">Benutzerangaben</th>
</tr>
<tr>
<td width="33%" valign="top" class="row1">Vorname / Nachname:</td>
<td width="58%" valign="top" class="row1"><input name="vorname" type="text" size="18,9">
<input name="name" type="text" size="19"></td>
</tr>
<tr>
<td valign="top" class="row1">Strasse / Nummer:</td>
<td valign="top" class="row1"><input name="street" type="text" size="30">
<input name="nr" type="text" size="7"></td>
</tr>
<tr>
<td valign="top" class="row1">PLZ / Wohnort:</td>
<td valign="top" class="row1"><input name="plz" type="text" size="7">
<input name="ort" type="text" size="30"></td>
</tr>
<tr>
<td colspan="2" valign="top" class="row1"><p align="center">
<input type="submit" name="Submit" value="Senden">
</p>
</td>
</tr>
</table></td>
</tr>
</table>
</form>
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_ANGABEN);
init_userprefs($userdata);
//
// End session management
//
//
// Generate page
//
$page_title = 'Benutzerangaben';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'shop_angaben.tpl')
);
$template->assign_block_vars('topics', array(
'CLASS' => $class,
'S_ANGABEN_ACTION' => append_sid('shopangaben.'.$phpEx)
));
$sql = "UPDATE phpbb_users
SET user_plz = $plz
WHERE user_id = " . $userdata['user_id'] . "";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'ERROR ', '', __LINE__, __FILE__, $sql);
}
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
www.aprilia-racing-forum.de