Jump to content

Better to use full path or relative path?


MrFish
 Share

Recommended Posts

Like the title asks: Is it better to use a full path or relative path when including files in php?

include('includes/login.php');include('http://www.mysite.com/includes/login.php');

Does it matter or is it quicker to use a relative path?

Link to comment
Share on other sites

Relative paths are better - or else what happens when your environment changes?Also, you can't include() files over HTTP, at all.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...