robcrozier Posted December 13, 2008 Share Posted December 13, 2008 Hi, i was just wondering if anyone could give me any advice on setting up paths within my php scripts. Basically, i have a lot of include() functions going on, from many different locations. Relative paths are starting to give me a headache! How does everyone else set up their paths with their working on a large php project? Do you set up an absolute path in a config file for example? If so how exactly do you do this? I've tried a few ways of setting up an absolute path within my script, however some aren't recognised my javascript (which is also important for me!) and images etc? Any advice would be great. Quote Link to comment https://forums.phpfreaks.com/topic/136856-how-should-i-set-my-paths/ Share on other sites More sharing options...
sKunKbad Posted December 13, 2008 Share Posted December 13, 2008 use the path from the server such as: include "/var/www/includes/some_include.php"; Quote Link to comment https://forums.phpfreaks.com/topic/136856-how-should-i-set-my-paths/#findComment-714738 Share on other sites More sharing options...
robcrozier Posted December 13, 2008 Author Share Posted December 13, 2008 That's one of the methods that i've tried actually, however javascript does not recognise it and nor do images. PHP files are OK with this but i need something that i can use for all my JS includes and images too. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/136856-how-should-i-set-my-paths/#findComment-714741 Share on other sites More sharing options...
sKunKbad Posted December 15, 2008 Share Posted December 15, 2008 Show an example of how javascript doesn't recognize it. What are you trying to do? Javascript has it's own ways of importing data. You don't need php to import data for use by javascript. Quote Link to comment https://forums.phpfreaks.com/topic/136856-how-should-i-set-my-paths/#findComment-715540 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.