SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am trying to get the URL of my webpage into a script, but for some reason.. either I am a total dumbo, or there's something fishy with my PHP service..

    Here's what I have:
    Code:
    echo "http://".$HTTP_HOST.$PATH_INFO;
    But there is nothing displayed. Does anyone know if the NetNation hosting service has some sort of funny PHP installation?

    Thanks.
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  2. #2
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    i did a copy and paste with absolutely no changes and it gave me exactly my url back.

    What it does not do is identify any directories below the url. I tried it in public_html, one secure dir and one unsecure dir and all came back with just the same http://www.noevalley.com never did see a dir.

    have no idea why it does not work for you.

    peace
    Last edited by edshuck; Feb 16, 2001 at 21:47.

  3. #3
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could try


    echo "http://".getenv("HTTP_HOST").getenv("PATH_INFO");
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  4. #4
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you think that NetNation has some sort of problem with their PHP configuration? What would cause these variables to NOT work?

    Any help would be appreciated, since I am planning to phone them and ask why it doesn't work.. it's unlikely they're PHP experts, and neither am I.. so it's kind of like the blind leading the blind on this one.

    What configuration options would be set (or not set) that would disable these variables?
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  5. #5
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The environment variables that are exposed in PHP are largely dependant on what version of PHP is being used (CGI, ISAPI, or Apache Module), and what Web server is being used (Apache, IIS, Sambar, etc.). Unfortunately, if NetNation's server isn't making those variables available, there probably isn't a lot you can do about it. A work-around should be possible, however.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


Bookmarks

Posting Permissions

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