http://www.icyphoenix.com/viewtopic.php?f=35&t=5299&p=35627#p35627
-----------------------------------
Gianni PB
Tue 13 Jan, 2009 17:06

Login And Redirect To Current Page
-----------------------------------
after the login, it redirects you to forum.php


I would want that redirect to current page before login.

I have found this code for the login.php, but I think it is for phpbb2


[spoiler][code linenumbers=false] <?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);

        // Start session management
        $user->session_begin();
        $auth->acl($user->data);
        $user->setup('ucp');

        if($user->data['is_registered'])
        {
            trigger_error('You are already logged in');
        }
        else
        {
            $username = request_var('username', '', true);
            $password = request_var('password', '', true);
            $autologin = (!empty($_POST['autologin'])) ? true : false;

            $result = $auth->login($username, $password, $autologin);

            if ($result['status'] == LOGIN_SUCCESS)
            {
                $redirect= $_SERVER['HTTP_REFERER'];
                $url = redirect($redirect, true);
                $time = 0;    //Seconds to wait before redirect
               
                echo '<meta http-equiv="refresh" content="' . $time . ';url=' . str_replace('&', '&amp;', $url) . '" />';
            }
            else
            {
                trigger_error('Login failed');
            }
        }
        ?> [/code][/spoiler]


I found this similar topic, but I cannot find a solution... :cry: 
www.icyphoenix.com/viewtopic.php?f=35&t=598


