如果我有一个文件示例。加载WordPress并检查用户是否登录到我的WordPress站点的php:
// Load WP
require_once(dirname(__FILE__) . \'/wp-load.php\' );
// Check if user is logged in and output a test message
if (is_user_logged_in()) {
echo \'User is logged in\';
} else {
echo \'User is not logged in\';
}
如何从WordPress网站的另一个服务器上运行此文件?因为我想检查查看网站A的当前用户是否登录到网站B上的WordPress网站。
使用jsonp处理ajax请求是可能的,但有没有非JS解决方案?
它不适用于cURL,因为我认为无法检查用户是否使用cURL登录。
PHP文档声明include() 和require() 可以有外部URL,如果allow_url_include 设置为1英寸php.ini, 但我已经读到了这方面的安全问题。
感谢您的帮助。