所以我正在使用WHMCS,我的主站点是www.hoststratus.com。我的WHMCS安装在https://clients.hoststratus.com,我正在尝试从主站点设置外部登录。出于某种原因,我无法获取会话UID。没有PHP错误。这是否可能来自没有SSL证书等的外部域?此外,如果您不熟悉WHMCS并且想知道会话来自何处,则它是从dbconnect.php生成的。
<?php
require("clients/dbconnect.php");
if ($_SESSION['uid']) {
echo "Welcome, you are logged in.";
} else { ?>
<div id="login-popup">
<input type="hidden" name="token" value="cabf6fe8fb6b2d4b47486809832256bff4865fed" />
<span class="login-pop-up-icon"></span><div>Client Login</div>
<form action="https://clients.hoststratus.com/dologin.php" method="POST">
<input type="text" placeholder="email address" name="username" required>
<input type="password" placeholder="password" name="password" required>
<input type="submit" value="Login">
<div><a href="https://clients.hoststratus.com/pwreset.php">forgot password?</a></div>
</form>
</div>
<?php } ?>
答案 0 :(得分:1)
参考:http://docs.whmcs.com/Creating_Pages
您可以将用户的会话ID获取为:
require("init.php");
$ca = new WHMCS_ClientArea();
$userid = $ca->getUserID() ;