i have a login script running one of two frames on a page, wehn frame_2 runs the script (a certain page), how can i have it refresh the other frame automatically ?
Printable View
i have a login script running one of two frames on a page, wehn frame_2 runs the script (a certain page), how can i have it refresh the other frame automatically ?
I did something like this with an IFRAME before, should react the same way.
in the nav frame I called a function in the body frame. The body frame was given the name pricelist.. so from the nav frame it looked like this
function exePricelist()
{
pricelist.document.runChecker();
}
and in the runChecker function on the pricelist frame it said something like this.
function runChecker()
{
window.location.href = 'whatever.html';
}
hope that helps
ok, i tried that, and it didnt seem to work for me. this is how i used it:PHP Code:IF ($action == "do_login")
{
setcookie("gdb_user", $upass, time()+3600);
$message = "login will be active for approximately 1 hour";
ECHO '<script language="javascript">function exePricelist() {side_menu.document.runChecker();}</script>';
}
damn thats tough. I thought it would work. I'm not getting it over here. I noticed what I have done differently, instead of calling the function I call a form to submit..
pricelist.theform.submit();
and that seemed to work fine... and I passed info between the frames...
MAIN FRAME GRABBING FROM NAV FRAME
var discAmnt = window.parent.document.theform.discAmnt.value;
Hmm... maybe its easier for you to just see my code...
http://www.visualwow.com/pages/prici...4&startimage=0
That page has the iframe and the info passed back and form and the submit button which calls a php page.
thanx, i'll have to have a look at that tomorrow :) (its 1:00, so i have to go to sceep)
all that will do is print out the script. you need to call the function to get it to work. ut the script up in the head part of the page and then just try this.PHP Code:IF ($action == "do_login")
{
setcookie("gdb_user", $upass, time()+3600);
$message = "login will be active for approximately 1 hour";
ECHO '<script language="javascript">function exePricelist() {side_menu.document.runChecker();}</script>';
}
PHP Code:IF ($action == "do_login")
{
setcookie("gdb_user", $upass, time()+3600);
$message = "login will be active for approximately 1 hour";
ECHO "exePricelist()";
}
this will just write "exePricelist()" to the screen (i'm writing straight into html here). so how can this work ?PHP Code:IF_($action_==_"do_login")
________{
________setcookie("gdb_user",_$upass,_time()+3600);
________$message_=_"login will be active for approximately 1 hour";
________ECHO_"exePricelist()";
________}
what is with the _ in the code?
ok I figured it would do that. then do it without the echo.
orPHP Code:IF ($action == "do_login")
{
setcookie("gdb_user", $upass, time()+3600);
$message = "login will be active for approximately 1 hour";
exePricelist();
}
PHP Code:IF ($action == "do_login")
{
setcookie("gdb_user", $upass, time()+3600);
$message = "login will be active for approximately 1 hour";
echo "<script>exePricelist();</script>";
}
"exePricelist();" - gives following error: "Fatal error: Call to undefined function: exepricelist() in c:\windows\desktop\files\wwwroot\gdb\admin\action.php on line 9". as expected though, PHP cant directly access javascript functions.
echo_"<script>exePricelist();</script>"; - gives following error: "Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in c:\windows\desktop\files\wwwroot\gdb\admin\action.php on line 9"