Original geschrieben von TobiaZ
aber du bist schon eingeloggt?
aber du bist schon eingeloggt?
<form action="log.php" method="post">
<input type=text name=username><br>
<input type=text name=password><br>
<input type=submit value="klicken">
</form>
<?
class PHPBB_Login {
function PHPBB_Login() {
}
function login( $phpbb_user_id ) {
global $db, $board_config;
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;
require_once( './forum/config.php' );
define('IN_PHPBB',true);
$phpbb_root_path = "./forum/";
require_once( $phpbb_root_path . "extension.inc" );
require_once( $phpbb_root_path . "common.php" );
return session_begin( $phpbb_user_id, $user_ip, PAGE_INDEX, FALSE, TRUE );
}
function logout( $session_id, $phpbb_user_id ) {
global $db, $lang, $board_config;
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;
require_once( './forum/config.php' );
define('IN_PHPBB',true);
$phpbb_root_path = "./forum/";
require_once( $phpbb_root_path . "extension.inc" );
require_once( $phpbb_root_path . "common.php" );
session_end( $session_id, $phpbb_user_id );
setcookie( $board_config[ "cookie_name" ] . "_sid", "", time() - 3600, " " );
setcookie( $board_config[ "cookie_name" ] . "_mysql", "", time() - 3600, " " );
}
}
?>
<?php
session_start();
include("logclass.php");
$user = new User();
$user->login( $_POST['username'], $_POST['password'] );
$phpBB = new PHPBB_Login();
$phpbb->login( $user->id );
echo $user->id;
?>
Kommentar