Results 1 to 4 of 4
  1. #1

    Probably a Simple PHP Question

    I have a script in which I need to get the domain of the site the script is running on into a variable in PHP so for example if someone uploads the script to their site - - the variable $domain in the PHP script needs to be set to the Hope that makes sense.

    I've looked in to using $_SESSION but I can't find a variable that retrieves just the domain. If anyone could help I'd be really greatful.


  2. #2
    Join Date
    Jun 2004
    Digital Texas
    look into the $_SERVER command. if u run <?php phpinfo(); ?> on ur site, u can see what output the domain name. then jsut use that command with the server variable. ex. $_SERVER['HTTP_REFERR_AGENT']; or something along those lines. PM me and I can give ya the actual code when I get home and have access to my manuals and sources.

  3. #3
    Join Date
    Feb 2004
    I think $_SERVER['SERVER_NAME'] is what you're looking for. Have a look at

  4. #4
    Thanks, that works great.
    The Complete Client Management, Billing & Support System

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts