I've been trying to get my user redirect page to work in wordpress, but rather than redirect, it publishes my html code. I can see that the code is correctly reading the variable value from my Caspio database, but it doesn't do anything else - except show the code to the enduser. What am I doing wrong??? Any help would be appreciated. Thanks
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
Jodie
Hi
I've been trying to get my user redirect page to work in wordpress, but rather than redirect, it publishes my html code. I can see that the code is correctly reading the variable value from my Caspio database, but it doesn't do anything else - except show the code to the enduser. What am I doing wrong??? Any help would be appreciated. Thanks
<script>
if("[@authfield:PW_tbl_user_approle]" == "Admin"){
window.location = "https://www.mysitename.com/admin/";
}
else if ("[@authfield:PW_tbl_user_approle]" == "post"){
window.location = "https://www.mysitename.com/manager/";
}
else if ("[@authfield:PW_tbl_user_approle]" == "apply"){
window.location = "https://www.mysitename.com/user/";
}
else if ("[@authfield:PW_tbl_user_approle]" == "View"){
window.location = "https://www.mysitename.com/employee/";
}
else{
window.location = "https://www.mysitename.com/public/";
}
</script>
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.