SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    PHP_SELF problems

    Hi Guys

    One of my clients hosted accounts has changed servers, always a problem, but this time Im getting problems I cant see why.

    I use a pagination system I wrote several years ago, has been working fine since then until now

    The source of the problem is the $_SERVER['PHP_SELF'] command which is returning an extra two layers of directories now than before.

    Before I had

    www.domain.com/subsite/En/search.php

    Now Im getting

    www.domain.com/htdocs/web/subsite/En/search.php

    so its taking into account the layers below my web directory on the server !! even through the webpage URL in the browser still shows the top version

    Any thoughts ??
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  2. #2
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do the following...

    print_r($_SERVER);

    should contain something like request uri or something that might help you...

    ... self will return script path to home root.

  3. #3
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks

    Quote Originally Posted by lemonzoo View Post
    ... self will return script path to home root.
    Which should be set on the server to the domains root directory ??

    After years of PHP programing Ive never had this problem before PHP_SELF always has returned the path from the domain root to the script being run, after all thats what its there for.

    A stern email to the hosting company seems to have done the trick, as PHP_SELF is now working as should. Hopefullly it will stay that way.

    Thanks again for your reply
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming


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
  •