buildings.php
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if(!$userdata['session_logged_in'])
{
redirect(append_sid("login.$phpEx?redirect=buildings.$phpEx", true));
}
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
//
// Start output of page
//
define('SHOW_ONLINE', true);
$page_title = $lang['Index'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'buildings_body.tpl')
);
///
/// Anweisung zum Updaten der Datenbank
///
if (!empty($buttom))
{
echo("Buttom gedrückt");
$db_query = "UPDATE phpbb_users
SET user_posts = user_posts + 4,
user_cash = user_cash - 500,
user_holz = user_holz - 300,
user_stein = user_stein - 500,
user_church = user_church + 1
WHERE user_id = " . $userdata['user_id'];
if (!$db->sql_query($db_query))
{
message_die(GENERAL_ERROR, 'Could not update userdata', '', __LINE__, __FILE__, $db_query);
}
}
//
// Generate the page
//
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Code: Alles auswählen
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="row1" align="left" width="1%"><img src="xxx" />
</td><td class="row1" align="left" width="50%"><span class="gensmall">Kirche
</td><td class="row1" align="right" width="50%">
<form name="form1" method="post" action="buildings.php?buttom=1"><input type="submit" name="Buttom" value="Buttom"></td></form>
</tr>
</table>
Ergebnis
Name: tre
PW: tre
Ich würde das Problem ja gerne lösen, aber irgendwie will es einfach nicht ...
