Hi all
thanks for reply. After spending almost two days on this I finally diagnosed the problem but still searching for answer.
I am restating the problem below:
I have testframe.php that loads testinpform.php into right frame containing code to create 3 buttons. when I load the testframe.php, It shows all the the buttons in the right frame and all the buttons work as desired for the first time. once a button is clicked, none of the buttons work work after. When I move to some other page using some other link and come back, then these buttons start working again.
This beavior is shown by Chrome browser.
In chrome itself, if I load testinpform.php, all the buttons work as desired.
In firefox, the same code work pefectly fine with or without frame.
So, Is this a problem of chrome or I need to add something in my code to make it work in all browsers.
My code is as follows.
testframe.php
<?php
// This code creates two frames. The left frame is a textarea that you can write
// PHP code in and execute it. On the right frame you will see the result of the
// code that was executed.
/* -BEGIN PHP TESTER */
function generateFrames() {
echo "<FRAMESET COLS=\"360,*\">\n";
echo "<FRAME noresize NAME=\"input\" SRC=\"otherfile.php?page=left\">\n";
echo "<FRAME NAME=\"output\" SRC=\"testinpform.php?page=right\">\n";
echo "</FRAMESET>";
}
if($page=="left") {
echo "<BODY BGCOLOR=\"#FFFFFF\">";
echo "<FONT FACE=\"Arial,Verdana,Helvetica\" COLOR=\"FF0000\" SIZE=\"3\">PHP Tester</FONT>";
echo "<FORM METHOD=\"get\" ACTION=\"processForm.php?page=right\" TARGET=\"output\">\n";
echo "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">\n";
echo "<TR><TD><TEXTAREA NAME=\"input\" COLS=\"100\" ROWS=\"40\"
WRAP=\"virtual\">".$input."</TXTAREA></TD></TR>\n";
echo "<TR><TD ALIGN=\"center\"><INPUT TYPE=\"submit\"
VALUE=\"Execute\"></TD></TR></TABLE></FORM>\n";
echo "</BODY>";
}
else if ($page=="right") {
echo "<BODY BGCOLOR=\"#FFFFFF\">";
if(empty($input)) {
echo "Ready to parse...";
}
else {
$input=stripSlashes($input);
eval($input);
}
echo "</BODY>";
}
else {
generateFrames();
}
/* END PHP TESTER */
?>
testinpform.php
<?php
$filenames = array("file1.txt", "file2.txt", "file3.txt");
$namesToshow = array("file1", "file2", "file3");
$numfiles = count($filenames);
for ($i = 0; $i< $numfiles; $i++)
{
echo"<form enctype=multipart/form-data method=GET action='viewResult.php' target='_blank' >";
echo"<input type='hidden' name='filetoview' value= $filenames[$i] >";
echo"<input type='submit' value= $namesToshow[$i] >";
echo'</FORM>';
}
echo"<a href= abc.com>click here to go to next page and then come back using the back button>";
?>