简体   繁体   中英

How can I get the vbulletin logout hash on another page? (PHP)

I want to get the logout hash for vBulletin so that I can link to the logout bit directly from my main site.

How can I do this? (in PHP)

The logout hash is loaded into the global userinfo array, so it's available to you when you've included the "global.php" file.

A very basic example of creating a page with just the logout link might look like this (assuming your script is in the vBulletin directory):

<?php
include('./global.php');
if($vbulletin->userinfo['userid'] > 0){
    echo '<a href="login.php?' . $session[sessionurl] . 'do=logout&amp;logouthash=' . $vbulletin->userinfo['logouthash'] . '">Logout</a>';
}
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM