[PHP] basedir

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by diabolo, Feb 11, 2008.

  1. diabolo

    diabolo Community Advocate Community Support

    Messages:
    1,682
    Likes Received:
    32
    Trophy Points:
    48
    does anyone know any pre defined variable that I can get the root address of my site, since I tried using $basedir = "http://www.mysitehere.com";
    but php doesn't allow url file access

    so does anyone know an alternative method?

    http://www.spinthatyoyo.com - for the problem
     
    Last edited: Feb 11, 2008
  2. leafypiggy

    leafypiggy Manager of Pens and Office Supplies Staff Member

    Messages:
    3,819
    Likes Received:
    163
    Trophy Points:
    63
    what do you mean root adress? and upgrading your PHp version might help
     
  3. deadimp

    deadimp New Member

    Messages:
    249
    Likes Received:
    0
    Trophy Points:
    0
    Try using parse_url(), and looking at the 'host' index.
     
  4. MasterMax1313

    MasterMax1313 New Member

    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    0
    there are some very useful php directory commands here
     
  5. Synkc

    Synkc Active Member

    Messages:
    1,765
    Likes Received:
    0
    Trophy Points:
    36
    $_SERVER['DOCUMENT_ROOT'] - Super Global which contains the path to your root web directory (public_html).
     
  6. diabolo

    diabolo Community Advocate Community Support

    Messages:
    1,682
    Likes Received:
    32
    Trophy Points:
    48
    thanks Synkc for the variable, now I am having trouble adding in the '/'
    this is my current code, how do I go about adding the foward slash without it getting parsed into the code?
    $basedir = $_SERVER['DOCUMENT_ROOT'];
     

Share This Page