• Resolved insomniacp

    (@insomniacp)


    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="http://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 http://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 &amp to get it to go to the url but I simply get the full string in the url
    http://www.XXXXXXXX.com/?page_id=2&ampstate=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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Where are you putting this script?

    Thread Starter insomniacp

    (@insomniacp)

    at the top of the page, there is a google script as well there so I figured it would be safe. The script is called when a drop down menu is changed.

    Thread Starter insomniacp

    (@insomniacp)

    added to the head of the file and it is not working. I guess the ampersand gets parsed in the_content part but not up there so it works now.

    I have very similar issue when using “qtranslate” and redirect.
    Still no answer in the qtranslate forum…
    Hope I’ll find the solution here.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘ampersand in redirect url’ is closed to new replies.