Results 1 to 4 of 4

Thread: importing an other php file

  1. #1

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Resolved importing an other php file

    I have a php page and I am importing an other one. In the start of the first php file I am opening up the DB and all that, furuther down in that PHP file I am importing the the other one. Do I still have to open the DB in that file too?




    ØØ
    Last edited by NoteMe; Feb 10th, 2005 at 04:37 PM.

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: importing an other php file

    No. It will inherit the connection.
    Like Archer? Check out some Sterling Archer quotes.

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: importing an other php file

    When you import a file using include or require te following happens:
    • PHP mode exits and HTML mode is entered.
    • The entire file is evaluaated as if it were at there at that point in the soource code.

    You have access to all the variables you would originally have access to. If inside a function you will have access to all the local variables and the global variables from the $GLOBALS array, just like you normally would.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: importing an other php file

    Thanks that worked exactly as you guys said.

    1/5 of my menu is PHP now...


    http://63.247.129.10/~oyvost/


    Reps are out to both of you...well not you Adam, I have to spread them a bit more first.....I have it on a yellow post-it so I won't forget though..



    ØØ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width