1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how do i find base path and base url???

Discussion in 'PHP' started by Lovette, Mar 8, 2009.

  1. #1
    hey whats up?
    can someone please tell me how to find this?



    // Base path (e.g. '/home/username/public_html/')
    $sm['path_base'] = '/home/intavant/public_html/dev/smys/';

    // Base URL (e.g. 'http://www.example.com/')
    $sm['url_base'] = 'http://www.smys.dev.intavant.com/';




    how do i find my BASE PATH?and BASE URL?
    i downloaded an open source ready made script for running a myspace layout site and all i have to do is upload all the files to my server and change some things in the config.php file.
    i have the files uploaded inside a folder called "freedesigns"
    The freedesigns folder is a folder that i created...and inside the free designs folder i downloaded all the files of the script i there
    i did this because i didnt want the script to be the index page of my site www.nnennalovette.com
    i wanted for the visitors on click the "free designs" button on my home page and then it will take them to the "index" page for the layouts...by the way the script if a full myspace layout site...
    did i make any sense?
    SEMrush
    please help me
    thankxxx in advance
     
    Lovette, Mar 8, 2009 IP
    SEMrush
  2. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #2
    Try one or more of the following things.

    echo $_SERVER['DOCUMENT_ROOT'];
    echo DIR(__FILE__);
    echo $_SERVER['SCRIPT_NAME'];
     
    exodus, Mar 10, 2009 IP
  3. Josh Lloyd

    Josh Lloyd Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Don't try the above post without making a backup and reading a guide on how to apply a backup, please.

    Your base path if you have standard shared hosting with cPanel will be

    home/username/public_html/freedesigns
    Code (markup):
    where the username is what you use to login to your cPanel hosting account.

    Your base URL is

    http://www.nnennalovette.com/freedesigns
    Code (markup):
    Josh.
     
    Josh Lloyd, Sep 26, 2017 IP
  4. SoftLink

    SoftLink Greenhorn

    Messages:
    35
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    13
    #4
    Do what exodus says. They're just 'reads'. They don't affect files, security or anything.
    That's how you get that information in PHP.
     
    SoftLink, Oct 3, 2017 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,401
    Likes Received:
    1,876
    Best Answers:
    245
    Trophy Points:
    515
    #5
    ... and you got that bit of nonsensical BS where exactly? Careful, your ignorance is showing.
     
    deathshadow, Oct 11, 2017 IP
  6. Harshal shah

    Harshal shah Active Member

    Messages:
    126
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    65
    #6
    echo dirname(__FILE__)
    or
    echo basename(__FILE__);
    etc.
    $base_url="http://".$_SERVER['SERVER_NAME'].dirname($_SERVER["REQUEST_URI"].'?').'/';
     
    Harshal shah, Oct 14, 2017 IP
    SoftLink likes this.