Jump to content
  • 0

page redirection in WordPress showing the HTML script and not executing


Jodie

Question

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...