NEED HELP. Call another PHP Page in PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karuchan
    New Member
    • Apr 2007
    • 2

    NEED HELP. Call another PHP Page in PHP

    Hello, it is my first time here and I am basically a beginner at programming PHP.

    I need help regrading PHP calling.

    Suppose I have a page named Index.php for a site and wanted to call a page named navigator.php into the page itself. The navigator.php page is made with PHP scripts and HTML tags. Sorry I forgot the codes at home because I don't have internet connection there.

    I tried using the file() function but it doesn't execute my session code in the navigator.php.

    Can there be any possible way to get around this?

    I'll update this post with the codes so everyone can help me analyze this. Thanks.
  • rogerpride
    New Member
    • Mar 2007
    • 7

    #2
    Originally posted by karuchan
    Hello, it is my first time here and I am basically a beginner at programming PHP.

    I need help regrading PHP calling.

    Suppose I have a page named Index.php for a site and wanted to call a page named navigator.php into the page itself. The navigator.php page is made with PHP scripts and HTML tags. Sorry I forgot the codes at home because I don't have internet connection there.

    I tried using the file() function but it doesn't execute my session code in the navigator.php.

    Can there be any possible way to get around this?

    I'll update this post with the codes so everyone can help me analyze this. Thanks.

    The easiest way is to probably use the HTML <iframe> tag. That is if you really want to "embed" the other php page into the main php page.

    <iframe src="navigator. php" scrolling="auto "></iframe>

    file() is good for getting non-php files like xml, text and other stuff like that, but probably not for what you want here. Check out php.net for function descriptions.

    If navigator.php contains functions that you want to run on your main page, just use the include statement in your main page:

    <?php
    include ("navigator.php ");
    ?>

    Hope this helps.

    Comment

    • jadoo
      New Member
      • Mar 2007
      • 8

      #3
      Originally posted by karuchan
      Hello, it is my first time here and I am basically a beginner at programming PHP.

      I need help regrading PHP calling.

      Suppose I have a page named Index.php for a site and wanted to call a page named navigator.php into the page itself. The navigator.php page is made with PHP scripts and HTML tags. Sorry I forgot the codes at home because I don't have internet connection there.

      I tried using the file() function but it doesn't execute my session code in the navigator.php.

      Can there be any possible way to get around this?

      I'll update this post with the codes so everyone can help me analyze this. Thanks.
      I am not sure this will help u or not but i think if u want to use the index.php in the navigator.php u can do this by using require (),or include() function .may be these help u.u can read about this at php.net official site of php.

      Hope it may help u.
      Good Luck

      Comment

      • karuchan
        New Member
        • Apr 2007
        • 2

        #4
        Thanks for the help guys, i'll try it later, then i'll post for updates. Thank you again
        rogerpride
        The easiest way is to probably use the HTML <iframe> tag. That is if you really want to "embed" the other php page into the main php page.

        <iframe src="navigator. php" scrolling="auto "></iframe>

        file() is good for getting non-php files like xml, text and other stuff like that, but probably not for what you want here. Check out php.net for function descriptions.

        If navigator.php contains functions that you want to run on your main page, just use the include statement in your main page:

        <?php
        include ("navigator.php ");
        ?>

        Hope this helps.
        jadoo
        I am not sure this will help u or not but i think if u want to use the index.php in the navigator.php u can do this by using require (),or include() function .may be these help u.u can read about this at php.net official site of php.

        Hope it may help u.
        Good Luck

        Comment

        Working...