Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hey, I am bored over the holidays so thought I woukd try a ftp/file browser class.

    First problem.

    I have my script in a subfolder, directly below the root (www.mydomain.com/sub)

    I am trying to return the www.mydomain.com part

    This is to produce links to the files, as for developing purposes I am browing another subdirectory. (/sub is reading from /misc)

    I have using $_SERVER['HTTP_HOST'] and $_SERVER['DOCUMENT_ROOT'] - but these return the full name.. such as www.mydomain.com/home/username/public_html/sub ..

    Cheers

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Why not a [minicode]preg_replace( '/([^/]*)\/.*/', '$1', $_SERVER['HTTP_HOST'] );[/minicode]?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:44 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com