Short of using a cookie, is there an easy way to pass a variable value across a frame? Specifically, I'm using a drop down menu (<OPTION VALUE="feedback.php?thisVar=1">), etc. from a top frame page. The feedback.php then displays into the middle frame page. But the variable value is not being displayed. I can display the actual variable name but not it's value.

If someone can suggest a solution, please be specific enough for a newbe like me. Does the solution require php code within the top frame page or just within the feedback.php file?

    Your question is not clear and has a couple of confusing elements:

    I'm using a drop down menu (<OPTION VALUE="feedback.php?thisVar=1"> ), etc. from a top frame page

    What's happening here? I'd guess you are using some sort of javascript script. Does the script cause the whole page to refresh? Or are you trying only to refresh the inner frame?

    I can display the actual variable name but not it's value

    What does this mean? What method are you using that displays a name but not a value?

      Yes, the JavaScript drop down resides in one frame and is targeting another frame. The goal is to have this drop down communicate a url containing a php variable to another frame so that when the target frame refreshes, it makes use of the php variable that was sent to it from the drop down frame.

      Please forget I mentioned diplaying the variable name. My feedback.php code had quotes around the variable name at that point.

        I have a solution to the original question which asked how to pass a variable value from a top frame to a targeted middle frame. The top frame has a JaveScript drop down menu with the following:

        <CENTER><P><SELECT NAME="TheA" value="" onchange=switchA()>
        <OPTION SELECTED>Page_A
        <OPTION VALUE="feedback.php?thisVar=One&thatVar=Four">Page_A_One
        <OPTION VALUE="feedback.php?thisVar=Two&thatVar=Five">Page_A_Two
        <OPTION VALUE="feedback.php?thisVar=Three&thatVar=Six">Page_A_Three
        </SELECT></P></CENTER>

        The JavaScript switchA() function is:

        function switchA() {
        var listA = document.forms[0].TheA;
        var chosenItemA = listA.options[listA.selectedIndex].text;
        if (chosenItemA == "Page_A") {
        return false;
        }else {
        var listA = document.forms[0].TheA;
        parent.middle.location = listA.options[listA.selectedIndex].value;
        parent.head.location = "head.php";
        }
        }

        The middle frame is refreshed by the feedback.php and that frame can display both variables obtained by the drop down selection using echo $GET['thisVar'] and echo $GET['thatVar']. But the refresh of the top frame cannot pass the variable values using the "head.php" file.

          6 days later

          My solution was to use JavaScript slice() and concat() to strip off variables with values starting from the first "?" question mark character and then connect it to a different php file.

          parent.head.location = "head.php".concat((listA.options[listA.selectedIndex].value).slice(12));

            Write a Reply...