Jump to content

psterling

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

psterling's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The basic html WORKS!!!  I can't believe the solution has been so simple, and I've been wondering what the difference was for years (when something didn't work, I just did it the other way, but never really understood)!
  2. [quote author=Hi I Am Timbo link=topic=111099.msg449991#msg449991 date=1160498516] <a href="/foo/bar.php">Foo's Bar from the http root</a> [/quote] I'm gonna do a little testing with this.  I've been coding html for 5+ years now, but didn't really ever have a complete grasp on the difference between: foo/bar.php AND /foo/bar.php You might have just answered my initial question (and ENLIGHTENED me in the process!).  It appears that maybe I can do what I wanted without the config.inc file? Question:  If I have a hyperlink in a file (www.mysite.com/a/b/c/d/test.html), and I want to relatively reference (www.mysite.com/result.html), you're saying I can just have my reference as (/result.html)? If so, I've been taking the LOOOONG way around for the last 5 years!
  3. I was afraid you'd say that.  The full server path appears to work just fine for uploading files, however.  Too bad I can't work the links this way--it seems it would be much easier!  Thanks for the ultra-quick response, though (<4 minutes)!!
  4. Hi. I've scoured this board for the last 2.5 hours, but can't seem to find the solution to my problem. I am trying to modify my php code to make my site completely portable (domain-name independent), and so I can more easily write it on my testing server, then upload to the live server once completed.  Therefore, I want to avoid using absolute links as much as possible. I have written a file (config.inc) that contains the global config settings, and included it with each php file.  I tried to set the base path using two different methods, which both give me the same result: $config['root'] = '/hsphere/local/home/myaccount/mysite.com/'; AND $config['docRoot'] = $_SERVER['DOCUMENT_ROOT']; However, when I try to use either in a link, I get the following address result: http://www.mysite.com/hsphere/local/home/myaccount/mysite.com/index.php That is clearly wrong--I wanted this instead: http://www.mysite.com/index.php I can easily get the desired result by using $_SERVER['HTTP_HOST'], but it's my understanding that this absolute reference will make the site not portable (it's always looking for http://www.mysite.com). Anyone know how to achieve my objective?  Ultimately, I would like to do something like the following, and it act like a normal relative reference (i.e. ../../docs/misc/example.html): <a href="<?php echo $_SERVER['DOCUMENT_ROOT']?>/docs/misc/example.html">Test Link</a> Thanks in advance...
×
×
  • 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.