根据用户角色在网址上重定向按钮 [英] Button redirect on url based on user role
问题描述
我把这段代码放在了Text小部件中。你有什么建议(角色问题)吗?
{
function get_user_role();
if($ user_role == food)
{?>
< script>
function goack(){
window.location.href = http:// localhost / ..;}}
< / script>
else {?>
< script>
函数goack(){
window.location.href =http:// localhost / ...;}
< / script>
?>
}
和按钮我插入此
goack();
只有在没有的情况下它才会发生。提前谢谢
Hi, i have put this code in a Text widget. Have you got some advice(problem with roles)?
{
function get_user_role();
if($user_role==food)
{?>
<script>
function goack(){
window.location.href="http://localhost/..";}
</script>
else{?>
<script>
function goack(){
window.location.href="http://localhost/...";}
</script>
?>
}
and in button i insert this
goack();
it goes only on else not on if. Thank you in advance
推荐答案
user_role == food)
{?>
< script>
函数goack(){
window.location.href =http:// localhost / ..;}
< /脚本>
else {?>
< script>
函数goack(){
窗口。 location.href =http:// localhost / ...;}
< / script>
?>
}
并且在按钮中我插入这个
goack();
只有在其他地方没有打开。提前谢谢
user_role==food)
{?>
<script>
function goack(){
window.location.href="http://localhost/..";}
</script>
else{?>
<script>
function goack(){
window.location.href="http://localhost/...";}
</script>
?>
}
and in button i insert this
goack();
it goes only on else not on if. Thank you in advance
这篇关于根据用户角色在网址上重定向按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!