Results 1 to 7 of 7

Thread: CD / DVD Rom Drive Detection

  1. #1
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CD / DVD Rom Drive Detection

    I have a PHP website that I would like to put on CD.

    I have got the basics of this working, using Server2Go.

    Due to the setup of the website (it has some nifty image search function) the absolute path to image folder has to be defined (ie: c:/wamp/www/products/images/)

    So, does anyone know of a way to detect what drive the CD was inserted into so I can replace the 'c:/' portion of the path to the correct letter when it is viewed from the CD...

    Any help / suggestions are much appreciated.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    $_SERVER['script_filename'] will give a path, though relative in some cases.
    Play with the various server vars here:
    http://www.php.net/manual/en/reserved.variables.php
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    In DOS/Windows, you can say \wamp\www\products\images, which will start from the root of the current drive.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    WAMP? Is that when it is compiled as well?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    As far as I'm aware, WAMP is a binary package for Windows compromising Apache, MySQL, and PHP. The user doesn't compile it...
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Sorry. I misread the information. I was under the impression it was running from the CD as some type of standalone, not just installed as a "server".
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the help guys.

    I've had some success using $_SERVER['DOCUMENT_ROOT'] to discover the drive letter.

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
  •