Announcement

Collapse
No announcement yet.

Redirect after Custom PHP Logout

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Redirect after Custom PHP Logout

    I'm using a custom php script to logout users from vBulletin.
    Here is my script which is working as expected:

    PHP Code:
    //Init the vBulletin system
    require_once( '/forum/includes/vb5/autoloader.php' );
    vB5_Autoloader::register'/forum' );
    vB5_Frontend_Application::init'config.php' );

    //Get user info
    $vb_userInfo vB_Api::instance'user' )->fetchUserinfo();

    //Log out URL
    $logout_url '/forum/auth/logout?logouthash=' $vb_userInfo'logouthash'];
    header"Location: $logout_url); 

    Because I'm using header() function to load the logout URL, the user gets redirected to forum home page after being logged out which is a subdirectory of my site.
    What I'm trying to do is to redirect the user to the home page after successful logout.
    I did try to use curl for this purpose, but that didn't work either.
    Any suggestions on how to do so?
Working...
X