index.html
Codice PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<TITLE>titolo</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Expires" content="-1">
</head>
<body>
<iframe name="cont" width="1px" height="1px" src="cart.php" style="visibility:hidden" >
</iframe>
<div style="padding-left:0px; padding-top:0px;" id="main_div"></div>
</body>
</html>
cart.php
Codice PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Untitled</title>
<script language="JavaScript" type="text/JavaScript">
function load_content () {
if (parent.document.getElementById('main_div')) {
parent.document.getElementById('main_div').innerHTML=document.getElementById('inner_frame').innerHTML;
}
if (!parent.document.getElementById('main_div')) {
window.location=('index.html') ;
}
}
</script>
</head>
<body onLoad="load_content()">
<div id="inner_frame">
contenuto carrello
</div>
</body>
</html>
E' chiaro che nella index i link punteranno all'iframe "cont"