x10Hosting Forums

Corporate Free Hosting for the Masses.



Register

View Poll Results: Relative paths or fixed paths?
Relative 8 100.00%
Fixed 0 0%
Voters: 8. You may not vote on this poll

Reply
 
LinkBack Thread Tools Display Modes
x10 Spammer

tnl2k7's Avatar

Join Date: Nov 2007
Posts: 3,139
Credits: 14,274
tnl2k7 is a glorious beacon of light
Location: #offtopic ;)

Quote  
08-20-2008, 07:17 AM
Relative paths or fixed paths?

Just wondering if you prefer to use relative paths or fixed paths when designing websites, and whether you use fixed paths in PHP for includes/requires/fopens and stuff. It came to me when I was trying to move WordPress on my test PC to my x10Hosting account and discovered it uses fixed paths for everything . I'm just gonna do a resinstall and put a few useful posts up, my blog was abandoned and full of crap anyway lol.

But anyway, relative or fixed paths?

I tend to use relative paths where possible because it's easier to move something around. If I need to use fixed ones, I have a variable somewhere which is easy to change and means I get the benefits of using relative ones.

-Luke.
__________________
No longer staff as of 28th November 2008
Just Discuss - forums about everything

Last edited by tnl2k7; 08-20-2008 at 07:19 AM.
Reply With Quote
tnl2k7 is offlineReport Post
VIP User

LadyAnna's Avatar

Join Date: Aug 2007
Posts: 210
Credits: 2,687
LadyAnna is on a distinguished road
Location: Sweden

Quote  
08-20-2008, 08:11 AM
Re: Relative paths or fixed paths?

I'd say relative as well, for the flexibility. Nothing breaks if I change addy

btw, for the wordpress stuff, it's easy to change, as it is actually stored in database as a variable (you set it in admin area stupid enough, blog url and homepage url). However you can edit it through phpmyadmin, in settings table there are two rows that handle the url of the blog. You need to change them both.

Last edited by LadyAnna; 08-20-2008 at 08:15 AM.
Reply With Quote
LadyAnna is offlineReport Post
x10 Spammer

Smith6612's Avatar

Join Date: Dec 2007
Posts: 2,664
Credits: 3,179
Smith6612 is just really nice
Quote  
08-20-2008, 08:49 AM
Re: Relative paths or fixed paths?

I use relative paths. I've found it to be less of a hassle down the road when working with my websites. The only time I need to change a relative path is when I mass move content around.
__________________


THE SENTRY'S A SPY!
Reply With Quote
Smith6612 is offlineReport Post
x10 Spammer

tnl2k7's Avatar

Join Date: Nov 2007
Posts: 3,139
Credits: 14,274
tnl2k7 is a glorious beacon of light
Location: #offtopic ;)

Quote  
08-20-2008, 09:46 AM
Re: Relative paths or fixed paths?

Quote:
Originally Posted by LadyAnna View Post
I'd say relative as well, for the flexibility. Nothing breaks if I change addy

btw, for the wordpress stuff, it's easy to change, as it is actually stored in database as a variable (you set it in admin area stupid enough, blog url and homepage url). However you can edit it through phpmyadmin, in settings table there are two rows that handle the url of the blog. You need to change them both.
Yes, but once you've changed that, any references to uploaded images are broken because they're fixed too. WordPress is an amazing software, but this is one thing that lets it down in my book. I've fixed it anyway, the site's back up with a new skin and some posts. Luckily there wasn't much in my old blog, most of it was announcements about issues with the arcade anyway. I just copied the 2 useful ones lol =P.

-Luke.
__________________
No longer staff as of 28th November 2008
Just Discuss - forums about everything
Reply With Quote
tnl2k7 is offlineReport Post
x10 Sophmore

allinone's Avatar

Join Date: Apr 2008
Posts: 221
Credits: 4,808
allinone is on a distinguished road
Location: <between embed tags>me</>

Quote  
08-20-2008, 11:23 AM
Re: Relative paths or fixed paths?

relative paths are always preferred bcoz you never know if there will be any changes on your directory, server, or the pale where data is placed
__________________
All in One

Reply With Quote
allinone is offlineReport Post
x10 Sophmore

Join Date: Jul 2008
Posts: 144
Credits: 1,416
xav0989 is on a distinguished road
Quote  
08-20-2008, 12:40 PM
Re: Relative paths or fixed paths?

I always try to use relative paths instead of fixed paths to be able to move the root folder of place in another folder. I even created a script to modify the relative path when the include script is in a root folder and needs to get scripts in other folders, children and parent.
Reply With Quote
xav0989 is offlineReport Post
x10Hosting Member

chappill's Avatar

Join Date: Feb 2008
Posts: 74
Credits: 1,162
chappill is on a distinguished road
Quote  
08-20-2008, 02:40 PM
Re: Relative paths or fixed paths?

Definitely got to be relative, if I have to move host for whatever reason unless I use the same user name I'm stuffed, with over 400 files editing all the path files would be a right pain in the bum.
Reply With Quote
chappill is offlineReport Post
x10Hosting Member

jazzencat's Avatar

Join Date: Aug 2008
Posts: 19
Credits: 371
jazzencat is on a distinguished road
Quote  
08-23-2008, 02:16 AM
Re: Relative paths or fixed paths?

this was in HTML, but I usually used relative paths for the links to pages within my site and fixed only when linking to external sites. This meant that I could pull and save the entire site with layout on my computer and test it out before uploading it. Very useful when you are working with dial-up and limited hours per month of access.
Reply With Quote
jazzencat is offlineReport Post
x10 Sophmore

TheMan177's Avatar

Join Date: Jan 2008
Posts: 162
Credits: 1,343
TheMan177 is on a distinguished road
Location: Australia

Quote  
08-23-2008, 02:26 AM
Re: Relative paths or fixed paths?

Relative paths, but if I must use fixed in a project it will be stored in a variable in one location - easy to change if need be.
Reply With Quote
TheMan177 is offlineReport Post
x10 Lieutenant

cowctcat's Avatar

Join Date: Nov 2007
Posts: 392
Credits: 5,201
cowctcat will become famous soon enough
Location: In front of a computer

Send a message via AIM to cowctcat
Quote  
08-23-2008, 12:19 PM
Re: Relative paths or fixed paths?

Well if im desining a site for someone i will try to use fixed paths just to smite them. hahaha. some times tey even pay you to fix your own bugs. where am i getting that crap from. I try to use reletive for my own things because why smite myself
__________________
--cowctcat
Senior Mod
Reply With Quote
cowctcat is offlineReport Post
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 10:34 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

Mortgage Calculator | Hsbc | MPAA | Myspace Proxy | Mortgage Calculator