> I think there can be trouble if the memory manager is just so and
> memory gets gobbled up by frames that load framesets that have
> many frames that in turn have many and so on...
The following PHP file is fun.
It generates a frameset consisting of two frames (canvas divided
horizontally) and loads into each a frameset consisting of two more
frames (divided vertically), thus splitting the canvas into four
rectangles. The total number of pages loaded now is 3.
Into each of these it loads a frameset splitting the frame horizontally
into three smaller frames (pages loaded: 7), and each of those is further
divided into three smaller frames vertically (pages loaded: 19). Your
canvas should now be divided into 1 x 4 x 9 = 36 rectangles.
Each of these 36 frames is then given a frameset (pages loaded: 55) that
horizontally subdivides it into 4 frames (pages loaded: 199), each of
which is subdivided into four frames vertically. 1 x 4 x 9 x 16 = 576
At this point, an artificial limit comes in and stops recursion from going
any further, but at this point the browser has downloaded close to 800
pages according to my calculations!
# $limit allows us to limit how far this page recurs.
# To be nasty, set $limit = 0.
$limit = 4;
$nframes = (int)$_GET['nframes'];
if ($nframes < 1)
$nframes = 2;
$ftype = 'cols';
if ($limit && $nframes>$limit)
# safety feature
# Generate frameset
$n = $nframes;
$f = implode(',', $f);
$frameset = sprintf('%s="%s"', $ftype, $f);
# Generate URL to load in each frame
$new_ftype = 'cols';
$new_nframes = $nframes;
$new_ftype = 'rows';
$new_nframes = $nframes + 1;
$url = sprintf('%s?nframes=%s&ftype=%s'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<frameset <?= $frameset ?>>
for ($i=0; $i<$nframes; $i++)
printf("<frame src=\"%s\">", htmlentities($url));
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact