ampersand in redirect url
-
Hello,
I am having an issue when I am doing a javascript redirect<script language="javascript"> function goto(form) { var index=form.select.selectedIndex if (form.select.options[index].value != "0") { page="https://www.XXXXXXXX.com/?page_id=2&state="+form.select.options[index].value; location=page;}} </script>
WordPress seems to be altering the ampersand so that it does not get properly sent as a regular ampersand to the browser, it gets sent as #038; which makes the redirect url become the following
https://www.XXXXXXXX.com/?page_id=2#038;state=IL
This does not work since php’s get functionality does not understand this. I have tried using & to get it to go to the url but I simply get the full string in the url
https://www.XXXXXXXX.com/?page_id=2&state=IL
Is there a way to force wordpress to not change the ampersand? Or is there some other way that I must represent the ampersand inorder for it to get into the url properly so I can use php to get the state data?
I can make a link with the page url above with the ampersand in it and it works perfectly normal but in the javascript redirect it for some reason messes up the ampersand in the url. With each link I get directed to if I just replace the useless ampersand changes then everything works well.
Thanks ahead of time.
- The topic ‘ampersand in redirect url’ is closed to new replies.