Jump to content

Recommended Posts

I'm trying to figure out how to resolve an issue with paths.

On my development computer, I load my home page like this:

http://localhost/hhs/index.php

 

On my server, I don't use the "localhost/hhs, so on the server the files are located up one folder in the tree.

 

In development, I can access a file by "hhs/lib/myfile.php" but on the server this does not work.  It must be changed to "lib/myfile.php"

 

I have tried what seems to be every combination of $_SERVER[HTTP_HOST] and __FILE__, but nothing is working. Please help!

this works..

<link rel="stylesheet" type="text/css" href=" <?php echo 'lib/css/site.css'; ?>" media="all" />

 

This will not work...

<link rel="stylesheet" type="text/css" href="<?php echo $myRoot.'lib/css/site.css' ; ?>" media="all" />

I have tried defining $myRoot as DOCUMENT_ROOT, HTTP_HOST, dirname(__FILE___) but none will load css file.

 

Any ideas? THanks.

 

Seems like this would be any easy task to accomplish.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.