what is http_root

Discussion in 'PHP' started by bhuppi890109, Apr 27, 2011.

  1. #1
    hey i am newbie in php. and when i am studying some projects then i have seen a HTTP_ROOT in php code.. what does it mean...
     
    bhuppi890109, Apr 27, 2011 IP
  2. TimK

    TimK Peon

    Messages:
    51
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    HTTP_ROOT isn't a predefined function or variable in PHP. It may be a user set variable.
     
    TimK, Apr 27, 2011 IP
  3. lioncub5

    lioncub5 Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    variables like your $HTTP_ROOT are used in php code to make it easier to move the program from one machine to another.
    many programmers build sites on their home machines. to access a web server running on your own machine, you go to localhost, or 127.0.0.1.
    so then all of the links you make need to begin with 127.0.0.1 to work on your machine.
    later, when you put the site up, you have to change all the links back to your dot com name.
    using a variable like you describe, you can just change that one variable, and presto...everything is changed.
     
    lioncub5, Apr 30, 2011 IP