Re: [PHP] Full versus relative URLs

2009-02-18 Thread Stuart
2009/2/18 PJ : > Paul M Foster wrote: >> On Wed, Feb 18, 2009 at 12:05:21PM -0500, PJ wrote: >> >>> Stuart wrote: 2009/2/18 PJ : > Stuart wrote: > >> >> >> >>> What confused me here is that often, in examples, there are all sorts of >>> references to files

Re: [PHP] Full versus relative URLs

2009-02-18 Thread Michael A. Peters
Johnny wrote: Hi Thodoris, In my opinion, the best use is to include your file with relative urls, like : I believe that it best. Including the hostname use to cause a dns lookup in some browsers which made it slower but I don't believe that is the case anymore. Doing the full path rel

Re: [PHP] Full versus relative URLs

2009-02-18 Thread PJ
Paul M Foster wrote: > On Wed, Feb 18, 2009 at 12:05:21PM -0500, PJ wrote: > >> Stuart wrote: >>> 2009/2/18 PJ : >>> Stuart wrote: >>> >>> > > > >>> >> What confused me here is that often, in examples, there are all sorts of >> references to files and there seems to be no standa

Re: [PHP] Full versus relative URLs

2009-02-18 Thread PJ
Bastien Koert wrote: > On Wed, Feb 18, 2009 at 12:05 PM, PJ wrote: > >> Stuart wrote: >>> 2009/2/18 PJ : >>> Stuart wrote: >>> >>> This generates a Fatal error: Cal to undefined function dirname() >> >>> The dirname function is present in both PHP 4 and 5 and does

Re: [PHP] Full versus relative URLs

2009-02-18 Thread Paul M Foster
On Wed, Feb 18, 2009 at 12:05:21PM -0500, PJ wrote: > Stuart wrote: > > 2009/2/18 PJ : > > > >> Stuart wrote: > >> > > > > > > > > > What confused me here is that often, in examples, there are all sorts of > references to files and there seems to be no standard as to how to refer > to

Re: [PHP] Full versus relative URLs

2009-02-18 Thread 9el
--- Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get a Free CD of Ubuntu mailed to your door without any cost. Visit : www.ubuntu.com -- On

Re: [PHP] Full versus relative URLs

2009-02-18 Thread Bastien Koert
On Wed, Feb 18, 2009 at 12:05 PM, PJ wrote: > Stuart wrote: > > 2009/2/18 PJ : > > > >> Stuart wrote: > >> > > > > > >> This generates a Fatal error: Cal to undefined function dirname() > > >> > > > > The dirname function is present in both PHP 4 and 5 and does not rely > > on

Re: [PHP] Full versus relative URLs

2009-02-18 Thread PJ
Stuart wrote: > 2009/2/18 PJ : > >> Stuart wrote: >> > > >> This generates a Fatal error: Cal to undefined function dirname() >> > > The dirname function is present in both PHP 4 and 5 and does not rely > on any external libraries. Are you sure you're spel

Re: [PHP] Full versus relative URLs

2009-02-18 Thread Shawn McKenzie
PJ wrote: > Stuart wrote: >> 2009/2/17 PJ : >> >>> Stuart wrote: >>> 2009/2/17 PJ : > Dotan Cohen wrote: > > So put it all in one place: >>> include "path.inc"; print""; ?> Full URL

Re: [PHP] Full versus relative URLs

2009-02-18 Thread Johnny
Thodoris a écrit : Here's a question related to my last post. When specifying a link in a HTML file (like to the css or an image file), there are two ways of doing it. One is to simply include the relative path to the file (relative to the doc root), like: /graphics/my_portrait.gif Or you can

Re: [PHP] Full versus relative URLs

2009-02-18 Thread 9el
--- Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get a Free CD of Ubuntu mailed to your door without any cost. Visit : www.ubuntu.com -- On

Re: [PHP] Full versus relative URLs

2009-02-18 Thread Stuart
2009/2/18 PJ : > Stuart wrote: > This generates a Fatal error: Cal to undefined function dirname() The dirname function is present in both PHP 4 and 5 and does not rely on any external libraries. Are you sure you're spelling it right? http://php.net/dirname > I must be really den

Re: [PHP] Full versus relative URLs

2009-02-18 Thread PJ
Stuart wrote: >>> This generates a Fatal error: Cal to undefined function dirname() I must be really dense... What I don't understand in the above is this - dirname refers to what directory? -- the directory of the file that is including? what if the directory is the root directory of t

Re: [PHP] Full versus relative URLs

2009-02-18 Thread PJ
Stuart wrote: > 2009/2/17 PJ : > >> Stuart wrote: >> >>> 2009/2/17 PJ : >>> >>> Dotan Cohen wrote: >>> So put it all in one place: >>> >>> >> include "path.inc"; >>> print""; >>> ?> >>> >>> Full URLs don't break when users save

Re: [PHP] Full versus relative URLs

2009-02-18 Thread Stuart
2009/2/18 PJ : > Stuart wrote: >> 2009/2/17 PJ : >> >>> Stuart wrote: >>> 2009/2/17 PJ : > Dotan Cohen wrote: > > So put it all in one place: >>> include "path.inc"; print""; ?> Full URLs don't break when

Re: [PHP] Full versus relative URLs

2009-02-18 Thread Stuart
2009/2/17 PJ : > Stuart wrote: >> 2009/2/17 PJ : >> >>> Dotan Cohen wrote: >>> >> So put it all in one place: >> >> > include "path.inc"; >> print""; >> ?> >> >> Full URLs don't break when users save the pages to disk. >> > That would be fine if the pages wer

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Michael A. Peters
PJ wrote: my server is FreeBSD 7.0 My situation is this: I am evolving www.ptahhotep.com from pure HTML to php-mysql-css (not an easy task for a newbie :-) ) The challenge is to set up the web site on my local server and then move it all to my web host. Unless I am mistaken, I am pretty sure I

Re: [PHP] Full versus relative URLs

2009-02-17 Thread PJ
Stuart wrote: > 2009/2/17 PJ : > >> Dotan Cohen wrote: >> > So put it all in one place: > > include "path.inc"; > print""; > ?> > > Full URLs don't break when users save the pages to disk. > That would be fine if the pages weren't being c

Re: [PHP] Full versus relative URLs

2009-02-17 Thread PJ
Michael A. Peters wrote: > PJ wrote: >> Michael A. Peters wrote: >>> PJ wrote: >>> I hope I'm not out of place here, but I have a problem that seems to be related. I am using some include statements for page headers with the pages in various directories on the site. The pro

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Michael A. Peters
PJ wrote: Michael A. Peters wrote: PJ wrote: I hope I'm not out of place here, but I have a problem that seems to be related. I am using some include statements for page headers with the pages in various directories on the site. The problem is this... if I put relative statements in the page (

Re: [PHP] Full versus relative URLs

2009-02-17 Thread PJ
Michael A. Peters wrote: > PJ wrote: > >>> >> I hope I'm not out of place here, but I have a problem that seems to be >> related. >> I am using some include statements for page headers with the pages in >> various directories on the site. The problem is this... if I put >> relative statements in th

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Stuart
2009/2/17 PJ : > Dotan Cohen wrote: So put it all in one place: >>> include "path.inc"; print""; ?> Full URLs don't break when users save the pages to disk. >>> That would be fine if the pages weren't being crafted in Dreamweaver, >>> where inserting links like th

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Dotan Cohen
> Easy to solve. > > ini_set("include_path", > "/srv/domain/phpinclude:/srv/domain/record_include:/srv/domain/process_include"); > > Then just call it without path - IE > > include('foo.inc'); > > php will first look for foo.inc in /srv/domain/phpinclude, then in > /srv/domain/record_include, etc.

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Dotan Cohen
> > Alternatively, $_SERVER['PHP_SELF']) could be switch()ed for known > > values, and $path be set accordingly with hardcoded values. >> Didn't notice this thread passing from the list. I will look into it. > > But sometimes you need to detect where something is located and that's the > point of t

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Michael A. Peters
PJ wrote: I hope I'm not out of place here, but I have a problem that seems to be related. I am using some include statements for page headers with the pages in various directories on the site. The problem is this... if I put relative statements in the page (header.php) like ../images/file.jpg

Re: [PHP] Full versus relative URLs

2009-02-17 Thread PJ
Dotan Cohen wrote: >>> So put it all in one place: >>> >>> >> include "path.inc"; >>> print""; >>> ?> >>> >>> Full URLs don't break when users save the pages to disk. >> That would be fine if the pages weren't being crafted in Dreamweaver, >> where inserting links like that is a pain. >> > > For th

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Thodoris
for that matter, you could use variables to specify the relative path to make it absolute within each of the production and dev environments. Another possible solution I can think is building configuration files that could include the paths and parse them to find the path every time y

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Thodoris
I know it's been said before, but beware of relying on this value just for the sole purpose of deciding where things are located, as without a bit of error checking on it, it can be used for injection attacks and what-not, although, sadly, I forget the exact post recently that had the link that

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Jim Lucas
Lewis Wright wrote: > But that's where mistakes are often made. It also means you need to > maintain a different live version to that of your development version. > If find it much easier to have relative paths and then there's no > build process needed to go live, I can just upload it. > > 2009/2

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Lewis Wright
But that's where mistakes are often made. It also means you need to maintain a different live version to that of your development version. If find it much easier to have relative paths and then there's no build process needed to go live, I can just upload it. 2009/2/17 Michael A. Peters : > Virgil

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Michael A. Peters
Virgilio Quilario wrote: > The difference is in manageability. > Copying the scripts to another domain and you're using full url for > your src and href when referring to local images or css or pages, will > give you trouble and you must change all of them to your new domain. which takes about 3

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Paul M Foster
On Tue, Feb 17, 2009 at 11:22:32AM +, Stuart wrote: > 2009/2/17 Paul M Foster : > > Maintaining identical development, staging and live environments is > one of the key components of reliable, repeatable and streamlined > development, testing and deployment, but if you're happy with what >

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Virgilio Quilario
> Here's a question related to my last post. When specifying a link in a > HTML file (like to the css or an image file), there are two ways of > doing it. One is to simply include the relative path to the file > (relative to the doc root), like: > > /graphics/my_portrait.gif > > Or you can include

Re: [PHP] Full versus relative URLs

2009-02-17 Thread Stuart
2009/2/17 Paul M Foster : > On Mon, Feb 16, 2009 at 08:49:06PM +, Stuart wrote: > >> 2009/2/16 Paul M Foster : > > > >> > >> > Agreed. But here's the real reason, in my case. We develop the pages on >> > an internal server, which has the URL http://pokey/mysite.com. When we >> > move the pages

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Paul M Foster
On Mon, Feb 16, 2009 at 08:49:06PM +, Stuart wrote: > 2009/2/16 Paul M Foster : > > > > Agreed. But here's the real reason, in my case. We develop the pages on > > an internal server, which has the URL http://pokey/mysite.com. When we > > move the pages to the live server at mysite.com, all

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Stuart
2009/2/16 Paul M Foster : > On Mon, Feb 16, 2009 at 07:39:29PM +0200, Thodoris wrote: > >> >>> Here's a question related to my last post. When specifying a link in a >>> HTML file (like to the css or an image file), there are two ways of >>> doing it. One is to simply include the relative path to t

Re: [PHP] Full versus relative URLs

2009-02-16 Thread German Geek
Tim-Hinnerk Heuer http://www.ihostnz.com Mike Ditka - "If God had wanted man to play soccer, he wouldn't have given us arms." 2009/2/17 Paul M Foster > On Mon, Feb 16, 2009 at 07:39:29PM +0200, Thodoris wrote: > > > > >> Here's a question related to my last post. When specifying a link in a >

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Dotan Cohen
> I know it's been said before, but beware of relying on this value just > for the sole purpose of deciding where things are located, as without a > bit of error checking on it, it can be used for injection attacks and > what-not, although, sadly, I forget the exact post recently that had the > lin

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Ashley Sheridan
On Mon, 2009-02-16 at 20:19 +0200, Thodoris wrote: > > On Mon, Feb 16, 2009 at 07:39:29PM +0200, Thodoris wrote: > > > > > >>> Here's a question related to my last post. When specifying a link in a > >>> HTML file (like to the css or an image file), there are two ways of > >>> doing it. One is t

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Dotan Cohen
>> So put it all in one place: >> >> > include "path.inc"; >> print""; >> ?> >> >> Full URLs don't break when users save the pages to disk. > > That would be fine if the pages weren't being crafted in Dreamweaver, > where inserting links like that is a pain. > For that you'd have to ask on the Dre

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Paul M Foster
On Mon, Feb 16, 2009 at 08:09:51PM +0200, Dotan Cohen wrote: > > Agreed. But here's the real reason, in my case. We develop the pages on > > an internal server, which has the URL http://pokey/mysite.com. When we > > move the pages to the live server at mysite.com, all the URLs would have > > to be

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Thodoris
On Mon, Feb 16, 2009 at 07:39:29PM +0200, Thodoris wrote: Here's a question related to my last post. When specifying a link in a HTML file (like to the css or an image file), there are two ways of doing it. One is to simply include the relative path to the file (relative to the doc root), l

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Dotan Cohen
> Agreed. But here's the real reason, in my case. We develop the pages on > an internal server, which has the URL http://pokey/mysite.com. When we > move the pages to the live server at mysite.com, all the URLs would have > to be rewritten. Ugh. > > Paul > So put it all in one place: "; ?> Full

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Paul M Foster
On Mon, Feb 16, 2009 at 07:39:29PM +0200, Thodoris wrote: > >> Here's a question related to my last post. When specifying a link in a >> HTML file (like to the css or an image file), there are two ways of >> doing it. One is to simply include the relative path to the file >> (relative to the doc r

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Thodoris
Here's a question related to my last post. When specifying a link in a HTML file (like to the css or an image file), there are two ways of doing it. One is to simply include the relative path to the file (relative to the doc root), like: /graphics/my_portrait.gif Or you can include the full UR

Re: [PHP] Full versus relative URLs

2009-02-16 Thread German Geek
Should be the same as the dns request is cached and a request needs to be made anyway. You could argue that relative URLs are less secure, but i cannot really see why. Well i guess someone can easier steal your source but it doesnt get much harder with absolute URLs. Tim-Hinnerk Heuer http://www

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Dotan Cohen
> My casual observation seems to indicate that the former will load faster > than the latter. But has anyone done any benchmarking on it? Did you clear the cache between tests? That could explain the speed difference. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-

Re: [PHP] Full versus relative URLs

2009-02-16 Thread Per Jessen
Paul M Foster wrote: > Here's a question related to my last post. When specifying a link in a > HTML file (like to the css or an image file), there are two ways of > doing it. One is to simply include the relative path to the file > (relative to the doc root), like: > > /graphics/my_portrait.gif