Click to See Complete Forum and Search --> : javascript variable into php?


muratisik
11-23-2003, 04:43 PM
Hello,
I am trying to build a php/javascript web site where there will be two frames, one being the control frame with buttons(left frame). Whenever anyone of these buttons gets pressed the other frame (right frame) will refresh and a variable in the php code in the other frame will have a new value. I had done this on a single fremless php page with this line at the end:

<INPUT TYPE=SUBMIT NAME="refresh" VALUE="Refresh">

This button Refresh would refresh the page and isset($HTTP_POST_VARS[refresh]) would return true.

Now I am trying to do the same thing over frames with no luck.

A gentleman in this forum gave me javascripts for the right and left frames:

right:

<script type="text/javascript">
var foo="foo";
onload = function() { document.getElementById('text').innerHTML = "Current value of the <em>foo</em> variable: " + foo; }
</script>
<div id="text"></div>

left:

<button onclick="parent.frames[1].foo='bar';parent.frames[1].document.getElementById('text').innerHTML='Current value of the <em>foo</em> variable: ' + parent.frames[1].foo;">Write "Hello, World!" to the other frame.</button>

My question is that can I use these codes or are there any way that I can load this new value for "foo" into a php variable and refresh the page just like the above SUBMIT does?

Have a nice day

Murat Isik