I hope that this is the correct forum for my question. If not, please let me know which one to post it on and I'll do so.

I have 2 pages (1 and 2 ... duh). Both are .php files. The first is a mix of html, javascript and php. The second is straight php.

The first page contains an IFRAME for displaying pages of documents generated in page 2, and contains the controls for which page to display (First, Prev., Next, Last). The controls are anchor tags located outside the IFRAME.

Page 2 calculates the actual page number and total pages in the document, and stores them in SESSION variables.

My problem is that I want to display the page number and total number of pages on page 1, outside the IFRAME.

I've tried a couple of things, like adding <?php echo '$variable name'?> and <?php echo '$_SESSION[variable name]'?>, but nothing seems to work. I think that the problem is that page 1 is never redisplayed. Only the text in the IFRAME changes. So, maybe I have 2 problems: How to get the data from page 2 to page 1, and how to cause it to be displayed without redisplaying page 1.

I know this is a bit convoluted, and I apologize. But if anyone can help I'd really appreciate it.