Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Include(), Require() functions to include other files.


    House
     Share

    Recommended Posts

    Include(): Adds a file into your script, from where all functions and variables can be used O.o If an error occurs, nothing else but a simple error message and the functions of the included file won't work anymore. All other things in the script who have nothing to do with the included file will still work xD

     

    Require(): Almost the same as include(), but when an error occurs, the whole script will stop working. This might be useful against abuse etc.

     

    To get into the root directory of your host (as far as you may come), write:

    "../index.php".

    To get into your own directory where the script which you are working with is located, write:

    "index.php".

    To work in another directory, write:

    "../otherDirectory/index.php"

     

     

    Include(): Fuegt eine Datei ins Script ein, woraus alle Variablen und Funktionen benutzt werden koennen. Wenn ein Fehler auftretet, geht das script trotzdem weiter nur die Includete Datei funktioniert nicht.

     

    Require(): Wie Include(), nur wenn es 1 Fehler gibt, hoert das ganze script auf zu arbeiten. Praktisch fuer wenn man fremde dateien includen will (zB anti sql injection und fehlerquellenaufspuerung usw^^)

     

    Um in die Root-Directory von deinem Host zu kommen, schreibst du:

    "../functions.php".

    Um in demselben Ordner zu arbeiten, einfach

    "functions.php".

    und um in ner anderen directory was zu holen: "../andererOrdner/functions.php"

    Edited by Mastermind Joe™
    Link to comment
    Share on other sites

    stimmt nicht ganz...

     

    wenn der aktuelle ordner zum Beispiel 4 Ornder höher liegt als ROOT muss man auch ../../../../FILE.TYPE machen

     

    if the current folder is 4 folders higher than the root directory you certanly must do 4 ../

    Link to comment
    Share on other sites

    include_once()

    require_once()

     

    would be nice also to see it explained too

     

    there are near never samples where you need to use ../ or more than 1 time, if you create a more file based application you create your own projectfolder put in your index.php that will controll everything and in that you can include all... also dont forget if you include the file /blaFolder/b.php into your index.php you are acting from b.php in the same directory as index.php not in blaFolder/

    Link to comment
    Share on other sites

    • 5 years later...

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    Loading...
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...