Index.html:
========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Frame tester</title>
</head>
<frameset name="parent" rows="20%,*" border="0">
<frame name="topframe" src="top.html" scrolling="no"/>
<frame name="mainframe" src="main.html" scrolling="no" />
</frameset>
</html>
top.html:
=======
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Top</title>
</head>
<body>
<form name ="topForm" action = "aPage.html">
$i value is  <input id ="iValue" type="text" />
</form>
</body>
</html>
main.html:
========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Main</title>
<script>
<!-- $i doit être récupéré du script PHP, il est stocké ici statiquement juste pour donner un exemple -->
var iVal = 12;
function loadValue(){
var topFrame = parent.frames('topframe');
topFrame.document.getElementById('iValue').value = iVal;
return iVal;
}
<!-- Cette fonction remplace la génération du tableau par ton script dans cet exemple -->
function buildTable(rowsCount){
var table = "<table>";
for(var i=0; i<rowsCount; i++){
var lineCount = i+1;
table += "<tr>";
table += "<td>Ligne"+lineCount+" Colonne 1</td>";
table += "<td>Ligne"+lineCount+" Colonne 2</td>";
table += "<td>Ligne"+lineCount+" Colonne 3</td>";
table += "<td>Ligne"+lineCount+" Colonne 4</td>";
table += "</tr>";
}
table += "</table>";
document.write(table);
}
</script>
</head>
<body onLoad="var x = loadValue(); buildTable(x);">
</body>
</html>
;-)
HackTrack