I am trying (so far unsuccessfully) to figure out how to call a URL into a page.

Page layout is accomplished via css and I would like to have a web page from a different part of the site called into the content area of the page.

If I use $filename = "url of page" -or- "path/to/php/page/to/be/displayed/" all I get is the page code.

Is there a way to call one web page into another other than using something like an iframe, something I want to avoid.

Thanks

    Im not sure what you mean so im going to try to guess..

    If you want it so if the url is http://domain.com?page=home it displays home and if its http://domain.com?page=news it displays news than use a switch statement..

    switch ($_GET['page']) {
      case 'home':
        //home content here
      break;
    
      case 'news':
        //news content here
      break;
    }
    

      I think theeper meant to use include('filename.php') or require('filename.inc.php') to include the content where u have
      //home content here
      etc..

        I'll try a more full explanation, that first one was a bit sparse

        I have a blog setup in the directory /pmachine where a 3 col blog layout is controlled by css.

        I'd like to wrap a php/MySQL discussion forum that is installed in /pmachine/forum/ into the blog by somehow having /pmachine/forum/index.php called into the content column div of the blog page at /pmachine/weblog.php

        include('forum/index.php') in the content div didn't work as the forum script couldn't locate other component information that it was looking for that lives in (for example) /pmachine/forum/include.

        Somewhere as part of the include I assume I need to set additional information to allow everything in /forum (and below) to be found so that it all works properly.

        Thanks

          Write a Reply...