I have a page with 3 frames. The main page has an include file which contains the majority of my php functions.

I would like to access those functions from within one of the 3 frames.

This is the main.php page.

include("func.php");

echo "<FRAMESET rows='50,*' border='0' FRAMESPACING='0'>"
."<FRAME src='menu.php' name='menuFrame' NORESIZE SCROLLING=NO frameborder=NO>";
echo "<FRAME name='top' src='top.php' marginwidth='10' marginheight='10' frameborder=no>";
echo "<FRAME SCROLLING=YES name='bottom' src='bottom.php' marginwidth='10' marginheight='10' frameborder=1>";
echo "</FRAMESET>";

#########################

Is there a way to use the functions stored in the "func.php" from the frame pages "top.php" or "bottom.php" pages.

    Hi

    Why don't you include() the file into your other frames? Am I missing something?

    dave

      Well I have a problem with the paths.

      The files in the frames are in different directories depending on whats been clicked in the menu which is in the menuFrame frame.

      The files loaded in the top & bottom frames come from the same directory.

      The main.php file that has the frames is in a higher directory.

      The included file also includes other files and the path gets screwed up. I get can't find some file errors.

      I guess the easiest way, barring a solution to my first post would be to restructure my directories.

        I would assume one of these functions might be useful.

        basename(), dirname(), pathinfo() or realpath();

        use of those functions while including func.php in all your pages. this means you might not have to restructure your directories after all.

          Write a Reply...