Professional Web Applications Themes

linking with home directory - PHP Development

I have a script that contains style sheets and I can't seem to link it on my Windows 2000 IIS server. It works perfectly fine on my Windows XP IIS server. Here is what I am trying to do. The index.php file (which links to the style sheets) is located in the MyScript folder and inside that folder is another folder called themes (where the style sheets are located). I am doing the following, which works fine on a Windows XP IIS server, but not my Windows 2000. // Path to script files (absolute file path) $HomeDir = "c:/inetpub/wwwroot/MyScript/"; // ...

  1. #1

    Default linking with home directory

    I have a script that contains style sheets and I can't seem to link it on my
    Windows 2000 IIS server. It works perfectly fine on my Windows XP IIS server.
    Here is what I am trying to do. The index.php file (which links to the style
    sheets) is located in the MyScript folder and inside that folder is another
    folder called themes (where the style sheets are located). I am doing the
    following, which works fine on a Windows XP IIS server, but not my Windows
    2000.


    // Path to script files (absolute file path)
    $HomeDir = "c:/inetpub/wwwroot/MyScript/";

    // Name of style folder
    $ThemeFolder = "default";

    //--- Then later in the page, I link the style sheet like this ---//
    echo "
    <link rel='stylesheet' type='text/css'
    href='".$HomeDir."themes/".$ThemeFolder."/style.css'>
    ";


    Like I said before, the style sheets load up fine on my Windows XP IIS server,
    but not the Windows 2000. In order to get it to work on the Windows 2000 IIS
    server, I have to link the style sheets relative to the folder I am working
    in, but I want to be able to move certain files into other directories without
    manually linking each one, so that's why I am linking them from the absolute
    home directory.

    Is there some setting in the php.ini file that deals with this? If anyone has
    suggestions, please let me know. I assume the above code would work on Linux
    systems without problems (given the correct home directory path). Can anyone
    verify this? Thanks a lot.


    Matt


    P.S. Sorry if this is a duplicate question. I didn't get any responses before,
    so I wasn't sure if it went through or not.


    Mpalermo Guest

  2. #2

    Default RE: [PHP] linking with home directory

    First, I'd create a simple test to see what the value of

    $newDir = $HomeDir."themes/".$ThemeFolder;
    print $newDir;

    And see what that yields. You might have a problem with your slashes.

    I find it extremely useful to have test variables print to the screen
    along the way to ensure that each new part of my code is receiving the
    correct information. It helps isolate where the problem data or logic
    lies. (becomes increasingly useful as you use many functions, classes,
    includes or just generally large scripts).


    -M

    -----Original Message-----
    From: mpalermo [mailto:mpalermovt.edu]
    Sent: Wednesday, July 09, 2003 11:37 AM
    To: [email]php-generallists.php.net[/email]
    Subject: [PHP] linking with home directory is evaluating to with the
    string addition:

    // Path to script files (absolute file path)
    $HomeDir = "c:/inetpub/wwwroot/MyScript/";

    // Name of style folder
    $ThemeFolder = "default";

    //--- Then later in the page, I link the style sheet like this ---//
    echo "
    <link rel='stylesheet' type='text/css'
    href='".$HomeDir."themes/".$ThemeFolder."/style.css'>
    ";



    Mike Brum Guest

Similar Threads

  1. linking to page link to top directory
    By bostonrose in forum Macromedia Contribute General Discussion
    Replies: 0
    Last Post: April 13th, 01:03 PM
  2. Verity - linking each directory in URL (ie.likebreadcrumbs)
    By TBJ in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: April 27th, 07:25 PM
  3. [PHP] Linking to files outside the directory structure...?
    By Jabber@Raditha.Com in forum PHP Development
    Replies: 1
    Last Post: August 28th, 10:03 AM
  4. [PHP] linking with home directory
    By Matt Matijevich in forum PHP Development
    Replies: 6
    Last Post: July 9th, 05:31 PM
  5. linking with home directory path
    By Mpalermo in forum PHP Development
    Replies: 1
    Last Post: July 9th, 12:12 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139