PDA

View Full Version : Redirect to a homepage after log out.


boiboi
07-31-2004, 07:19 PM
I'm not using vbhome. what I have is a regular site not integrated with vb. I'd like my vb to redirect to my homepage after users logout.

CarCdr
07-31-2004, 08:31 PM
I'm not using vbhome. what I have is a regular site not integrated with vb. I'd like my vb to redirect to my homepage after users logout.
This should work...

In login.php, find: $url = fetch_replaced_session_url($url);
eval(print_standard_error('error_cookieclear'));

}

// ############################### start do login ###############################
if ($_REQUEST['do'] == 'login')


Change the first two lines of it with:$url = 'YOUR HOMEPAGE URL GOES HERE';
eval(print_standard_redirect('Logout', false));

boiboi
08-01-2004, 05:09 PM
Ok that one works. Also can it have a 2 - 3 second delay so that users can see the options.

technicali taze
08-01-2004, 06:32 PM
i would like to use the same thing but can i set it to close window. my forum opens in new window from flash site. id like logout to then close the window.

plz ty

boiboi
08-03-2004, 03:59 AM
anyone?

AntonLargiader
12-20-2005, 12:00 PM
Same question for 3.5.2.

Different code in the logout section, so I don't want to do it by trial and error. :)

TIA.

psoexplorer
10-07-2006, 05:54 PM
Sorry for bumping a 10 month old thread, but it's the only one I found that had the exact same problem I was having.

I'm using 3.5.4 and have the same problem as the guy above - the code is different than the code posted in this thread. How can I redirect to the main site's index.php when logged out?

DarkDraco07
11-27-2006, 08:50 PM
same here <_<
need this for 3.6

codeMonkey32
12-05-2006, 08:40 PM
Not entirely sure if this is the 'correct' way to handle it, but it works for 3.6.0:

in your login.php file, find:
process_logout();

Immediately after that add:

header("Location: /url/to/your/redirect/page");
exit();


And that'll redirect you right after you click OK in the Alert window confirming you want to log out.

jasbell
02-19-2007, 03:03 AM
2 quick questions:

1) Any way to define the url to redirect to without putting it in the code? If yoyu want to redirect to some page in your domain cant you just use variables that represent
the domain
the path
any parameters and aram values

2) Dont I want to put the exit() function at the END of the code. EX:

process_logout();

$vbulletin->url = fetch_replaced_session_url($vbulletin->url);
if (strpos($vbulletin->url, 'do=logout') !== false)
{
$vbulletin->url = $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'];
}
$show['member'] = false;
eval(standard_error(fetch_error('cookieclear', create_full_url($vbulletin->url), $vbulletin->options['forumhome'], $vbulletin->session->vars['sessionurl_q']), '', false));

header("Location: /url/to/your/redirect/page");
exit();