注销按钮重定向 php
Logout button redirect php
我在 html、
中有这个注销按钮
<a href="<?php echo PSF::urlFor('logout');?>" class="link" id="position">Logout</a></li>
它进入 PSF class 并搜索注销功能,然后注销用户。
它工作正常。
现在我正尝试通过
在弹出窗口中执行相同的操作
return json_encode (
array(
'errors' => array(
'Sorry you are already logged in, please Logout from other Devices or click to"<a href="echo PSF::urlFor('logout');" class="link" id="position">Logout</a>"'
)
)
);
这个json被发送到,
if (d.errors) {
$("#load-overlay-elt").isLoading("hide");
$('#login_wait').button('reset');
a.empty();
var msg='';
$.each(d.errors, function(i, n){
//a.append(n + '<br/>');
msg += n + ', ';
});
$.auctions.alert(msg);
a.show();
}
消息已打印,但注销按钮似乎不起作用,我错过了什么吗?
你应该换行
return json_encode (array('errors' => array( 'Sorry you are already logged in, please Logout from other Devices or click to"<a href="echo PSF::urlFor('logout');" class="link" id="position">Logout</a>"')));
至
return json_encode (array('errors' => array( 'Sorry you are already logged in, please Logout from other Devices or click to <a href="' . PSF::urlFor('logout') . '" class="link" id="position">Logout</a>"')));
因为它在语法上不正确。
我在 html、
中有这个注销按钮 <a href="<?php echo PSF::urlFor('logout');?>" class="link" id="position">Logout</a></li>
它进入 PSF class 并搜索注销功能,然后注销用户。 它工作正常。
现在我正尝试通过
在弹出窗口中执行相同的操作return json_encode (
array(
'errors' => array(
'Sorry you are already logged in, please Logout from other Devices or click to"<a href="echo PSF::urlFor('logout');" class="link" id="position">Logout</a>"'
)
)
);
这个json被发送到,
if (d.errors) {
$("#load-overlay-elt").isLoading("hide");
$('#login_wait').button('reset');
a.empty();
var msg='';
$.each(d.errors, function(i, n){
//a.append(n + '<br/>');
msg += n + ', ';
});
$.auctions.alert(msg);
a.show();
}
消息已打印,但注销按钮似乎不起作用,我错过了什么吗?
你应该换行
return json_encode (array('errors' => array( 'Sorry you are already logged in, please Logout from other Devices or click to"<a href="echo PSF::urlFor('logout');" class="link" id="position">Logout</a>"')));
至
return json_encode (array('errors' => array( 'Sorry you are already logged in, please Logout from other Devices or click to <a href="' . PSF::urlFor('logout') . '" class="link" id="position">Logout</a>"')));
因为它在语法上不正确。