在一個PHP網站(沒有WordPress)我想檢查當前訪問者是否已經登錄另一個WordPress博客(不同的文件夾或域名)。在當前域名之外檢查WordPress登錄
我用這個代碼:
define('WP_USE_THEMES', false);
require('../wp-blog-header.php');
if(!is_user_logged_in())
{
exit('You do not have access');
}
它正常工作,如果PHP網站在這條道路
example.com/site/index.php
,但我得到錯誤500如果我使用它
SUBDOMAIN.example.com/index.php
define('WP_USE_THEMES', false);
require('httpS://www.example.com/wp-blog-header.php');
if(!is_user_logged_in())
{
exit('You do not have access');
}
是否有可能做一個跨域檢查?