PHP functions - path question

tomaszjot

Membership Suspended
Dec 22, 2009
1,934
77
0
Albany Plantation
So I have a websites developed in 'modules'. I created some functions so it is easy to maintain the website. My question: how I make the path to include the function?

When I do this: <?php include("header.php"); ?> everything is fine.
But when try <?php include("http://exampleofwebsite.com/some_folder/header.php"); ?> it doesn't work. For now I had to duplicate some functions and put them into specific folders however it will be nice to have a functions which I can reach anytime I need via path without duplicating them.

I tested some solutions on my localhost however could not make anything to work.

Appreciate any help. Thank you.
 


include loads files using local paths, not urls. so it would be something like /srv/www/domain.com/public_html/modules/header.php or however your file path is setup
 
include loads files using local paths, not urls. so it would be something like /srv/www/domain.com/public_html/modules/header.php or however your file path is setup

Actually, include does support URL's, you'd just be dumb to ever use it that way, and you'd need to have the URL return source.