The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I'm probably doing something wrong, but I'm having problems providing links on my pages (and calling PHP includes) when using site root relative links.
For example if I call my css file as follows;
the css fails to open, but I thought specifying the "/" at the front should make it open the css folder from the site root and then the flashgms.css file within that folder.
I can make document relative links work ("../css/flashgms.css", etc), but this becomes a real pain on my site as pages are situated within various folders.
I want to avoid using absolute links as this causes me other problems, like passing variables in my bits of PHP code that I'm using.
Any ideas?
Learning fast!!
Any chance you can set up a test page demonstrating this css link not working? You're linking to the css file twice at the moment and neither have a leading slash.
I think some of my problem is because I call other PHP files from within the one I include. Having a search on the web, I think I may be better to use the function command and have all my code in one PHP file.
The site is http://www.flashgms.com/
You absolute link (/pathtomycss/css.css) should work. No .htaccess rules?
If you are using php then you might want to try using the function getcwd() (get current working directory) which will append the absolute path for you.
As I understood it the leading / should specify the site root?
What I'm trying to avoid is having different links for pages that are in different folders, as it makes the use of templates very difficult.
I'm probably doing something wrong, but I'm having problems providing links on my pages (and calling PHP includes) when using site root relative links.
For example if I call my css file as follows;
the css fails to open, but I thought specifying the "/" at the front should make it open the css folder from the site root and then the flashgms.css file within that folder.
I can make document relative links work ("../css/flashgms.css", etc), but this becomes a real pain on my site as pages are situated within various folders.
I want to avoid using absolute links as this causes me other problems, like passing variables in my bits of PHP code that I'm using.
Any ideas?