Click to See Complete Forum and Search --> : window.location.href


ykwongss
01-23-2003, 01:21 AM
hi... i think i hav to explain my problem clearler..
i have 2frames named topFrame and mainFrame....
after modifying my codes...using parent.mainFrame.location.href...

<input type="button" name="indeks" value="<?php $d=$c+1; echo "$d"; ?>" CLASS="colornormal" ONCLICK="parent.mainFrame.location.href='http://localhost/Jpj_Test/frame/indeks_directpage.php?val=<?=$c;?>';">

as the code show teh button will redirect me into another php script named indeks_directpage.php.In this script i will do redirection to my desired html page..
The code in indeks_directpage.php are as follow

<?php
session_start();
$i=$val;
echo "here can display...........";

?>
<SCRIPT LANGUAGE="JavaScript">
parent.mainFrame.location.href = 'http://localhost/Jpj_Test/frame/Ques_<?php echo "$Rand[$i]"; ?>.php'
</SCRIPT>

i have even tried location.replace= 'http://localhost/Jpj_Test/frame/Ques_<?php echo "$Rand[$i]"; ?>.php'
but it didnt seems to work...


OK..now the real problem is in the first redirection to indeks_directpage.php is not a problem since i can see the echo "can see here" for a few miliseconds in the mainFrame....
but after that a blank page appear instead of the html page i desired...
BUT if i press back button in the web browser twice i can get my html page display nicely there!!!
hmmmmmm....
i think it must hav display the html page back to where i click the button...
any idea how to solve this...please advise...
any suggestion is highly appreciated...
thanx...

khalidali63
01-23-2003, 07:57 AM
From the looks of it and the way you have described your problem,it shows that you have a piece of cod eon your page that redirects to some other page which does not exist.
Put your complete code for both pages here or better links to those pages.
That will be help full

Khalid