I have a normal html document with an iframe pointed to a .php document (with links to other php documents). I would like the iframe height an/or width to change when page in the iframe changes. For example the initial page would generate an iframe height/width of 800/600. When you click a link in the iframe, the height/width would change to 600/400. Then yet another link would change the iframe, hight/width to 400/900.
I was thinking that i could somehow have variables for height and width set on each of the php documents that might show up in the iframe, and that each time a new page was loaded in the frame the new height/width variables would be sent to the parent frame, and the parent frame would refresh generating an iframe with the new dimensions.
I hope it is clear what I'm trying to do, I can try to clarify if necessary. The main point is I want an iframe to change dimensions base on the content. I don't mind if the parent frame has to refresh, but it must be automatic.
I don't really know much about php code, so I don't know if the idea I explicated above is the best method, or even if it is possible. If there is a better way please tell me how. If it is the best way, how would I code that?