Welcome to WebmasterWorld Guest from 220.127.116.11
I need to access this folder: /homepages/40/d1******9/htdocs/photos/
from /homepages/40/d1******9/htdocs/pages/ I can't use the normal relative addressing in my php pages because although on the same server they are different domains.
I have come across the PHP Symlink function: [uk2.php.net...]
My question is do I put this code on every PHP page that needs to access the 'external' folder?
I'm on shared Linux hosting and cannot access the config files.
You can include/require using a server path if that helps you i.e.
So you could set up whatever you want in the /photos/ directory then include it into you other pages. That still doesnt stop you having to put that code on every page though.
If I used - include('/homepages/40/d1******9/htdocs/photos/'); do I just refer to a file as if I'm already in that folder. For example, if I had an image callled mypic.jpg in the photos folder could I just refer to it as in <img src="mypic.jpg" >
There are many ways to create the symbolic link: If you have shell access, you can login, cd to the pages folder and create the symlobic link using the ln -s command. Or maybe your ftp program or cpanel file manager allows you to do that, or (what i usually do) just write a simple PHP script to call symlink() with the right arguments and run it once.
You may also need to enable the Apache Option "SymLinksIfOwnerMatch" or "FollowSymLinks" to your .htaccess file in the pages folder. (I'm guessing a bit here since i've never messed with symbolic links in the context of websites).
Hope this helps.