https://www.icyphoenix.com/viewtopic.php?f=35&t=5299 ----------------------------------- 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] 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 ''; } 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 ----------------------------------- Gianni PB Fri 06 Feb, 2009 12:20 Re: Login And Redirect To Current Page ----------------------------------- I found this: www.phpbbhacks.com/download/550 in particular redirect_outside.txt and redirect_register.txt I tried, but no good results... :roll: ----------------------------------- DWho Fri 06 Feb, 2009 15:39 Re: Login And Redirect To Current Page ----------------------------------- Hi My icy phoenix redirects to the current page after login now.... sorry am I miss understanding you question... ----------------------------------- Gianni PB Fri 06 Feb, 2009 15:59 Re: Login And Redirect To Current Page ----------------------------------- look at: http://www.pugliabaila.it/discografia/album/_compilation_2007_magiktumbaocompilation.php if you login there, you'll be redirect to index.php ----------------------------------- Gianni PB Sun 13 Dec, 2009 11:47 Re: Login And Redirect To Current Page ----------------------------------- Any ideas? ----------------------------------- KugeLSichA Sun 13 Dec, 2009 21:36 Re: Login And Redirect To Current Page ----------------------------------- Hey Gianni take a look at this codelines: [code linenumbers=false] if ( !$userdata['session_logged_in'] ) { redirect(append_sid(LOGIN_MG . '?redirect=YOUR_SITE.' . PHP_EXT, true)); } [/code] with this code you can set the page after login ----------------------------------- Gianni PB Thu 28 Jan, 2010 11:45 Re: Login And Redirect To Current Page ----------------------------------- Where can I put it? ----------------------------------- Gianni PB Thu 18 Feb, 2010 23:51 Re: Login And Redirect To Current Page ----------------------------------- I don't know if this is the best solution, but: [code linenumbers=false] echo "Ascolta Album!
"; if($_GET['$ascolta_login'] && !$userdata['session_logged_in']) redirect(append_sid(LOGIN_MG . '?redirect=' . $_SERVER['PHP_SELF'], true));[/code] and it works... :P