Click here to Skip to main content
15,889,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted
Comments
Mohibur Rashid 15-Sep-15 19:57pm    
what is food?
Have you defined anywhere?
if not try "food" or if its not a literal value but a variable then use $food. or else, if it is defined somewhere, such as define("food", "some value"); then check your $user_role variable.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900