我需要返回一个URL,该URL会在验证用户通过移动应用正确登录并向他们提供URL后,从我的PHP函数返回一个打开移动聊天支持窗口的URL。下面是我的代码示例。
<?php
if((isset($_POST['key']) && $_POST['key'] != "") && isset($_POST['userName']) && $_POST['userName'] != "")
{
$acc = new userAccount();
//if($acc->clientloginIntoAccount($_POST['userName'],$_POST['passWord'],$_POST['key']) == 1)
$Response = array();
if($acc->ClientLoginEncryptionUpgrade($_POST['userName'], $_POST['passWord'], $_POST['key'], $Response))
{
$_SESSION['clientloggedin'] = $Response['details']['session_data'];
$_SESSION['clientloggedin']['cost_centre'] = $Response['details']['company'];
$_SESSION['clientloggedin']['time'] = $_POST['time'];
$_SESSION['primary_color_1'] = $Response['details']['primary_color_1'];
$_SESSION['primary_color_2']= $Response['details']['primary_color_2'];
$_SESSION['footer_colour']= $Response['details']['footer_colour'];
$_SESSION['email_color'] = $Response['details']['email_color'];
$_SESSION['client_logo'] = $Response['details']['client_logo'];
$_SESSION['link_color'] = $Response['details']['link_color'];
$_SESSION['menu_items'] = $Response['details']['menu_items'];
$_SESSION['menu_items_icons'] = $Response['details']['menu_items_icons'];
$employee = getTableValue("personnel","id","employee_number='{$_POST['key']}'");
$_SESSION['loggedin']['personnelID'] = $employee;
echo "<script>window.location.href='home';</script>";
return "<script>javascript:void($zopim.livechat.window.openPopout())</script>";
}
else
{
echo "<div class = 'bg-danger'> Incorrect username / password. Please try again. </div>";
?>