Results 1 to 7 of 7

Thread: include()

  1. #1

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919

    include()

    if i had

    PHP Code:
    if(strlen($something)==0){
       
    //login code
    }


    if(
    strlen($something)==0){
    include(
    "login.inc.php");

    with the first one, the code is already there...does the include add the code in when it comes across it? my files are like 25kb now, postly php, and there are huge if/else clauses, i wanna see if i can do includes to reduce the download size...like you know what i mean?

    itll only download whats needed, not the whole thing
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    the php file that you specify in the include function will be "included" where the statement is found, so yes
    PHP Code:
    if(strlen($something)==0){
        include(
    "login.inc.php");

    would be fine

  3. #3

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    ok thanks

    but would it really matter since its parsed server side? or would it take less cpu?
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    the only real advantage is that it is less messy and a lot easier for you to work with.

    It might save some processing time if you are only including 1 vast section rather than a lot of vast sections in the same file.

  5. #5

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    ok its about 20 lines so ill just leave it then.

    thanks
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  6. #6
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    I'd do it for 20 lines

  7. #7

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    ah otay then
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

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